posted 21 years ago
You can use JSP to write JavaScript code, just like you'd do it with HTML.
Remember that JSP runs in the server-side, while JavaScript runs in the browser (client-side).
The following script should work:
Suppose aJSPVariable is the String "Bar". The code's output would be:
JavaScript objects do exist, but they're not commonly used. A JavaScript "class" has the same syntax as a JavaScript "function".
This is advanced JavaScript stuff and, like I said, not frequently used. Since you're a beginner, I think you should focus on learning basic JavaScript and creating dynamic scripts with JSP or Servlets.