For JSP 1.0, is there any way to use both standard Java scriptlets and JavaScript in the same JSP? (Motivation: Reuse of tool-generated JavaScript)

Scott Stirling

You can only use one server-side scripting language per JSP. You can use client-side JavaScript in a JSP as template text, with Java as the scripting language, but not both as the server-side scripting language at the same time.

Core JavaScript is similar enough to Java in syntax that you should be able to port your tool-generated script fairly easily to real Java. Not all JSP containers support JavaScript as a server-side scripting language, and none are required to. If you do use JavaScript as the scripting language in your JSP, remember that only the so-called "core" JavaScript will work. All client-side and server-side specific JavaScript requires either a web browser or a separate server extension to work, and that's not what's meant by supporting JavaScript as a JSP scripting language.

About | Sitemap | Contact