-
1. Re: Can not use Generics in JSP
danielywoo Oct 11, 2005 12:10 AM (in response to danielywoo)Does anybody know the behavior of tomcat jsp compiler? Why it doesnot support JDK5.0 features like generics?
-
2. Re: Can not use Generics in JSP
danielywoo Oct 11, 2005 3:58 AM (in response to danielywoo)I found the reason.
delete jdt compiler and copy ant.jar, tools.jar to tomcat.sar/conf
set compiler to 1.5 in default web.xml -
3. Re: Can not use Generics in JSP
nikolaymetchev Jan 17, 2006 9:54 AM (in response to danielywoo)This issue is duscussed in the Wiki:
http://wiki.jboss.org/wiki/Wiki.jsp?page=402UpgradeIssues
However I haven't been able to find out why the JDT compiler cannot be used for compiling Java 5 code. Is there a JIRA/Bugzilla issue to do with this? -
4. Re: Can not use Generics in JSP
p_saville1 Feb 16, 2006 2:45 PM (in response to danielywoo)JBoss IDE or Eclipse WTP, not sure which is doing my JSP compilation... But in the problems tab, all my JAVA 5.0 Generics code in JSPs show errors.
I am using Tomcat 5, and the JSPs compile and run fine in Tomcat... Just my IDE errors list is filling up with Generics errors in JSPs.
Is there a way to fix this? -
5. Re: Can not use Generics in JSP
j2ee_junkie Feb 16, 2006 3:06 PM (in response to danielywoo)What I did to solve this issue was to specify which JSP compiler to use in my web.xml file.
<web-app> ... <!-- specify jsp's compiler and java 1.5 standard --> <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> <init-param> <param-name>fork</param-name> <param-value>false</param-value> </init-param> <init-param> <param-name>xpoweredBy</param-name> <param-value>false</param-value> </init-param> <load-on-startup>3</load-on-startup> </servlet> ... <!-- The mapping for the JSP servlet --> <servlet-mapping> <servlet-name>jsp</servlet-name> <url-pattern>*.jsp</url-pattern> </servlet-mapping> ... </web-app>
enjoy, cgriffith