Question

As this thread shows, there seems to be an issue getting JSPs to compile in GWT hosted mode with the new Jetty server:

2. ERROR in /tmp/Jetty_0_0_0_0_8080_war____ut4fm1/jsp/org/apache/jsp/ 
test_jsp.java (at line 53) 
        new java.util.ArrayList<String>(); 
                                ^^^^^^ 
Syntax error, parameterized types are only available if source level 
is 1.5 

Does anyone have a workaround? It's possible that this commit might be related. I don't know what equivalent to org.eclipse.jdt.core.JDTCompilerAdapter should be used for building outside of Eclipse (e.g. on the command line). This is a real blocker for us adopting GWT 1.6, so any pointers are highly appreciated.

Was it helpful?

Solution

This problem is generated by the default values used by JspServlet, which compiles using 1.4 for source/target values.

  1. You can cofigure this servlet by adding

    <servlet>
        <servlet-name>jsp</servlet-name>
        <servlet-class>org.apache.jasper.servlet.JspServlet</servlet-class>
        <init-param>
            <param-name>compilerSourceVM</param-name>
            <param-value>1.5</param-value>
        </init-param>
        <init-param>
            <param-name>compilerTargetVM</param-name>
            <param-value>1.5</param-value>
        </init-param>
        <load-on-startup>3</load-on-startup>
    </servlet>
    
  2. There is one more issue as you can't configure JspServlet with the current jasper-compiler-5.0.28. You should download jasper-compiler-5.0.30 and make sure is in your classpath before gwt. There are other latest jasper compiler jars out-there but i'm not sore of how compatible are with jakarta-tomcat-5.0.28. I solved this problem by adding a dependency on jakarta-tomcat-5.0.30 in GWT 1.6.4. You can download the GWT compiled with this dependency from http://raisercostin.googlecode.com/files/gwt-windows-1.6.4.raisercostin.zip

I described the solution at http://code.google.com/p/raisercostin/wiki/GwtEclipsePluginDebug too.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top