tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jason Palmatier <cobrac...@yahoo.com>
Subject 404 Error when accessing pre-compiled JSPs
Date Wed, 02 Jun 2004 21:31:44 GMT
Hello everyone,

I am attempting to deploy pre-compiled jsps in Tomcat
4.1.18 (I can't upgrade, I'm stuck with 4.1.18).  I've
searched the archive extensively and found that I am
doing all the things suggested, but I still cannot
seem to find any of my web pages.  I'm wondering if
any of my steps are wrong and I'm just missing
something.  This is what I've accomplished so far:

1. Used JSPC to precompile all my jsp's and include
their subdirectory in their package statements (i.e.
if a jsp exist in myApp/myDir I create a package
statement of "package com.mycompany.myApp.myDir;" for
that jsp.

2. I compile the generated .java file into a class
file.  I make the output directory for the compile my
WEB-INF/classes directory so the javac command takes
care of creating all the subdirectories based on the
package statement of each .java file.

3. I copy the contents of the generated web.xml
fragments, merge them into one file (with proper
ordering, servlet declarations first, servlet mapping
after them, etc.) and then merge this into my existing
web.xml file.

4. I then remove all my .jsp files, wipe out
everything under my work/Standalone/localhost
directory, and restart Tomcat.

When I try to access my first page
(http://myserver:8080/pt/logon.jsp) I get a 404:
Requested resource is not available.

Here are a few things I've noticed and have questions
about:

1. In my servlet declaration statement can I name my
servlet the same as the class name?  i.e. if my jsp
compiles to
com.mycompany.myApp.subDir.anotherSubDir.myclass_jsp
can my servlet declaration look like this:

<servlet>
<servlet-name>com.mycompany.myApp.subDir.anotherSubDir.myclass_jsp
</servlet-name>
<servlet-class>com.mycompany.myApp.subDir.anotherSubDir.myclass_jsp
</servlet-class>
</servlet>

2. Just to make sure (since I know all the examples
show this already), you DO NOT want to include your
applications name in the url-pattern of a servlet
mapping, correct?  In other words, if my application
is under webapps/myApp then I want my servlet map to
say:

<servlet-mapping>
<servlet-name>com.mycompany.myApp.subDir.anotherSubDir.myclass_jsp
</servlet-name>
<url-pattern>/subDir/anotherSubDir/myclass.jsp</url-pattern>
</servlet-mapping>

NOT

<servlet-mapping>
<servlet-name>com.mycompany.subDir.anotherSubDir.myclass_jsp
</servlet-name>
<url-pattern>/myApp/subDir/anotherSubDir/myclass.jsp</url-pattern>
</servlet-mapping>

I feel like I'm really close to getting this running,
so this last stuff is very frustrating.  Any help
would be greatly appreciated.

Thanks,
Jason


	
		
__________________________________
Do you Yahoo!?
Friends.  Fun.  Try the all-new Yahoo! Messenger.
http://messenger.yahoo.com/ 

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Mime
View raw message