You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by "G.Nagarajan" <gn...@dkf.de> on 2000/12/13 14:19:01 UTC

Using Jspc for precompilation of JSPs

Hi,

I am using JSPC for precompiling the jsp pages in my web applications. This
is to avoid the delay when the page gets
compiled for the first time. As far as I understood, jspc creates the .java
files in the specified directory after which we
have to compile them. The web.xml file has to modified to add the
servlet-mapping tag. A sample web.xml can be
obtained using the -webxml option.

I give the following command

jspc -d c:\tomcat\webapps\test\web-inf\classes -webxml web.xml  -webapp
c:\tomcat\webapps\test

The command creates the .java files in the c:\tomcat\webapps\web-inf\classes
and a sample web.xml in the current directory.

The web.xml file contains the servlet mappings like

	<servlet>
		<servlet-name>Login</servlet-name>
		<servlet-class>Login</servlet-class>
	</servlet>

	<servlet-mapping>
		<url-pattern>\Login.jsp</url-pattern>
		<servlet-name>Login</servlet-name>
	</servlet-mapping>

Now, when I try to access Login.jsp, tomcat ignores the above and creates a
_0002f...test.java file and executes it.
But when I change the web.xml to say, (with "/" instead of "\")

	<servlet-mapping>
		<url-pattern>/Login.jsp</url-pattern>
		<servlet-name>Login</servlet-name>
	</servlet-mapping>
it works properly.

Is there any option which will make the web.xml to have the "/" instead of
"\". I am using tomcat 3.2.1 on Windows NT .

Thanks
Nagaraj.