InfoQ

News

JSPWeaver removes the first-person penalty from JSP development

Posted by Charles Humble on Feb 05, 2008 08:34 AM

Community
Java
Topics
Enterprise Architecture ,
Dynamic Languages
Tags
JBoss ,
WebLogic
ZeroTurnaround's JSPWeaver is a real-time interpreter for JSP which aims to remove the first-person penalty encountered when the server creates and compiles the background servlet from the JSP mark-up.

 

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 Posted Feb 6, 2008 11:01 PM
Re: How well does it deal with scriptlets? by Jevgeni Kabanov Posted Feb 7, 2008 6:39 AM
Re: How well does it deal with scriptlets? by Jevgeni Kabanov Posted Feb 7, 2008 6:40 AM
Great Job by Khaled Habiburahman Posted Feb 13, 2008 3:38 AM
  1. Back to top

    How well does it deal with scriptlets?

    Feb 6, 2008 11:01 PM by Tim Vernum

    Disclaimer: I wrote what is effectively a competing project, but I don't make any money from it, and I don't have a huge amount of attachment to it 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!)

  2. Back to top

    Re: How well does it deal with scriptlets?

    Feb 7, 2008 6:39 AM by Jevgeni Kabanov

  3. Back to top

    Re: How well does it deal with scriptlets?

    Feb 7, 2008 6:40 AM 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 :(

  4. Back to top

    Great Job

    Feb 13, 2008 3:38 AM by Khaled Habiburahman

    Great job, keep it up. I am going to give it a try.

Educational Content

Bindings, Platforms, and Innovation

This presentation focuses on the Internet and separating myth from fact, history from the future, and the mundane from the imaginative. Bob Frankston presents a vision of what could and should be.

Orchestrating Long Running Activities with JBoss / JBPM

This article explores the use of JBoss and jBPM to implement design solutions that effectively address the issue of orchestrating long running activities.

Neo4j - The Benefits of Graph Databases

This presentation covers the use of graph databases as an optimal solution for data that is difficult to fit in static tables, rapidly evolving data or data that has a lot of optional attributes.

Realistic about Risk: Software development with Real Options

This session introduces Real Options and shows how it can help in running your project. Real Options is a decision-making process that can be used to manage risk.

Communication Flexibility Using Bindings

This article discusses the use of bindings on services and references (including the instance of non-configured bindings) as the means to implement SCA communications in a Web and SOA environment.

Writing DSLs in Groovy

After a short introduction to DSLs, Scott Davis plays with the keyboard showing how to approach the creation of a DSL by typing working snippets of Groovy code that get executed.

Scaling Agile with C/ALM (Collaborative Application Lifecycle Management)

IBM Rational and InfoQ present, Scaling Agile with C/ALM, an eBook showing organizations how to become “finely tuned software delivery machines” by enabling team integration and scaling.

Concurrent Programming with Microsoft F#

Amanda Laucher presents a real life enterprise application written in F#. She shows actual code snippets, explaining design decisions and suggesting how to use some of the F# constructs.