Is JavaScript supported as a JSP scripting language under Tomcat?

Les Hazlewood

In short, no.

Putting things very very simply, Tomcat is essentially a Java Servlet Compiler, taking the .jsp file you write and translating it to a java servlet that runs in the background.

Java, according to the Apache development group that wrote Tomcat (known as the Jakarta group) conforms solely to the JSP 1.2 / Servlet 1.1 specification by Sun Microsystems. When they wrote Tomcat, they only had in mind to use Java as the "scripting language". In fact, Tomcat is built with java, thereby heavily integrating the technology.

I hope you know this, but JavaScript and Java are two entirely different languages (some things are similar, but most are not). The two technologies are by no means interchangeable, and this intuitively applies to Tomcat. To the best of my knowledge the Apache Tomcat developmental teams have no current plans to integrate other scripting technologies into the software (for many reasons, of which I won't go into here for brevity).

However, you may include JavaScript within the .jsp file (not within jsp interpretable <% %> tags), and it will be output to the client browser for interpretation just like in an HTML page. The key here is to realize that it has no interaction/functionlity with the server before it is sent to the client.

For more information please see:
The Jakarta Group

And more specifically, Apache's Tomcat Server