JSPWeaver removes the first-person penalty from JSP development
Configuring the product is straightforward. You put the jspweaver.jar into your web application's \WEB-INF\lib, and add some basic configuration information to the application's web.xml file to tell it to use the interpreter for *.jsp URLs:
<servlet>
<servlet-name>weaverServlet</servlet-name>
<servlet-class>com.zeroturnaround.jspweaver.JspInterpretingServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>weaverServlet</servlet-name>
<url-pattern>*.jsp</url-pattern>
</servlet-mapping>
Once the application server is re-started JSP pages will be interpreted on the fly.
The interpreter currently supports JSP 1.2-2.0. The 1.0 release supports the full JSP standard including common syntax, XML syntax and Java scriplets. It is container agnostic and should work with any JSP compliant container although the currently tested containers are:
- BEA Weblogic 8.1SPX, 9.X
- Jakarta Tomcat 4.X, 5.X, 6.X
- JBoss 4.X
- Jetty 5.X
- Oracle Application Server 9.X, 10.X
Support for JSP 2.1 is planned for the next release and Jevgeni Kabanov at ZeroTurnaround told InfoQ he expects it to be available in about a month. He also gave us a few more details on how the product works:
"It pretty much parses the JSP (either XML-style or original syntax, two separate parsers) and creates an in-memory representation of the pages, which can be used to render the actual output. Since the parsing is very quick and there is no translation it is much faster than compilation can ever be. We also use a patched version of BeanShell to interpret the embedded Java scriplets."
A free trial version is available from ZeroTurnaround. A license costs $49/seat.
How well does it deal with scriptlets?
by
Tim Vernum
Parsing scriptlets in an interpreter is hard.
You have conditionals that cross scriptlets, and it's incredibly difficult to support those without converting the whole thing into Java.
Does JSPWeaver really do it, or does it just do a "good enough" job (which is all slim does too)
Side note: Strictly speaking, JSPWeaver cannot be a standard compliant JSP implementation (not that it claims to be) as the JSP spec requires that pages be converted into servlets. (Uck!)
Re: How well does it deal with scriptlets?
by
Jevgeni Kabanov
Disclaimer: I wrote what is effectively a Parsing scriptlets in an interpreter is >hard.
You have conditionals that cross scriptlets, and it's incredibly difficult to support those without converting the whole thing into Java.
Does JSPWeaver really do it, or does it just do a "good enough" job (which is all slim does too)
Yep, it's hard, and yes we do that.
Re: How well does it deal with scriptlets?
by
Jevgeni Kabanov
Parsing scriptlets in an interpreter is hard.
You have conditionals that cross scriptlets, and it's incredibly difficult to support those without converting the whole thing into Java.
Does JSPWeaver really do it, or does it just do a "good enough" job (which is all slim does too)
Yep, it's hard, and yes we do that.
Somehow every time I post here formatting ends up messed up :(
Educational Content
Large-Scale Continuous Testing in the Cloud
John Penix May 24, 2013
Managing Build Jobs for Continuous Delivery
Martin Peston May 24, 2013
Clojure in the Field
Stuart Halloway May 23, 2013




Hello stranger!
You need to Register an InfoQ account or Login to post comments. But there's so much more behind being registered.Get the most out of the InfoQ experience.
Tell us what you think