Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Author Message
support-rkalla
Post subject: [Tomcat 5] How do I use Java 5 in my JSP pages?  PostPosted: Sep 03, 2006 - 06:56 PM
Registered Member
Registered Member


Joined: Jan 06, 2004
Posts: 23855

You can enable Java 5 compiler settings for your JSP pages in Tomcat by navigating to your <tomcat 5 install dir>\conf directory and then editing the web.xml file.

From there, scroll down to around line 212 or so and you will see the following servlet definition:
Code:

<servlet>
    <servlet-name>jsp</servlet-name>
    <servlet-class>org.apache.jasper.servlet.JspServlet</servlet-class>
    <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>


You can add a new init-param with the name compilerSourceVM and value of 1.5 to turn on the Java 5 features. The new init-param would look something like this:
Code:

<init-param>
    <param-name>compilerSourceVM</param-name>
    <param-value>1.5</param-value>
</init-param>


This feature in the default web.xml file that ships with Tomcat is described in the comment above this snippet of code that explains all the optional init-params you can pass to Tomcat on startup. Valid values are 1.4 and 1.5.
 
 View user's profile Send private message Visit poster's website  
Reply with quote Back to top
Display posts from previous:     
Jump to:  
All times are GMT - 6 Hours
Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Powered by PNphpBB2 © 2003-2004 The PNphpBB Group
Credits