-
1. Re: use jikes to compile JSP in default web.xml
jonlee Sep 22, 2003 8:11 PM (in response to michaellee)The default web.xml for the embedded Tomcat should exist in the Tomcat SAR located in the JBoss deploy directory. This configuration applies to all web applications unless overridden by a WARs web.xml.
The JSP servlet should look something like the following for the Jikes implementation:
<servlet-name>jsp</servlet-name>
<servlet-class>org.apache.jasper.servlet.JspServlet</servlet-class>
<init-param>
<param-name>development</param-name>
<param-value>false</param-value>
</init-param>
<init-param>
<param-name>checkInterval</param-name>
<param-value>900</param-value>
</init-param>
<init-param>
<param-name>compiler</param-name>
<param-value>jikes</param-value>
</init-param>
<init-param>
<param-name>javaEncoding</param-name>
<param-value>iso-8859-1</param-value>
</init-param>
<load-on-startup>3</load-on-startup>
YMMV for tuning and operational parameters. Read the Tomcat notes on configuring Jasper for more information and refer to the servlet specifications for standard servlet configuration parameters in web.xml. -
2. Re: use jikes to compile JSP in default web.xml
michaellee Sep 23, 2003 7:55 AM (in response to michaellee)Thanks for your reply.
However, i am using 3.0.6. Is the Tomcat SAR you mention just exists in 3.2?
Would you please specify the cooresponding name of the file in 3.0.6?
Regards,
Michael -
3. Re: use jikes to compile JSP in default web.xml
jonlee Sep 23, 2003 9:03 AM (in response to michaellee)Sorry, my bad. The 3.0.x releases lacked consistency in this area of configuration and deployment. The web.xml will be in the separate Tomcat-4.1.x/conf directory. Modify that accordingly. At the least, add the Jikes parameter and the encoding for Jasper to run correctly.
-
4. Re: use jikes to compile JSP in default web.xml
michaellee Sep 24, 2003 2:39 AM (in response to michaellee)Thanks. Actually, i have modified the web.xml to invoke jikes for JSP Compilation. Actually, my problem is that i am not sure whether jikes or javac has been used even after the modification. (since the message displayed is still [javac]).
Yesterday, i have search the web on this issue and following is obtained.
a simply way.
>
> don't set CATALINA_OPTS="-Dbuild.compiler.emacs=true"
>
> restart tomcat and request a jsp page with a syntax error like following
>
> BEGIN -----------------------
> <% x = 10 %>
> END ------------------------
>
>
>
> jikes produce this error:
> org.apache.jasper.JasperException: Unable to compile class for JSP
>
> An error occurred at line: -1 in the jsp file: null
>
> Generated servlet error:
> [javac] Compiling 1 source file
>
> [javac] Found 1 syntax error in
>
"/home/tfohrer/develop/Tomcat/4.1.17/jakarta-tomcat-4.0/dist/work/Standalon
>e /localhost/_/jikes_jsp.java":
>
> [javac] 43. x = 0
> [javac] ^---^
> [javac] *** Syntax: ";" inserted to complete ExpressionStatement
>
>
> javac produce this error:
> Generated servlet error:
> [javac] Compiling 1 source file
>
>
/home/tfohrer/develop/Tomcat/4.1.17/jakarta-tomcat-4.0/dist/work/Standalone
>/ localhost/_/jikes_jsp.java:43:
> ';' expected
> x = 0
> ^
>
/home/tfohrer/develop/Tomcat/4.1.17/jakarta-tomcat-4.0/dist/work/Standalone
>/ localhost/_/jikes_jsp.java:43:
> cannot resolve symbol
> symbol : variable x
> location: class org.apache.jsp.jikes_jsp
> x = 0
> ^
> 2 errors
>
I have performed the test and get the Jikes error message. Therefore, the web.xml i have modified is okay (just at the location you mentioned)
Thanks again for your support.
Regards,
Michael -
5. Re: use jikes to compile JSP in default web.xml
jonlee Sep 24, 2003 3:29 AM (in response to michaellee)Ah. I see that you were just trying to confirm Jikes invocation. You can also do that by removing the encoding definition as Jikes does invoke properly without it.