Servlet location question(s)

P

PJL

Using Tomcat 4.1.30 on Win XP Pro

Given the following:
-----------------------------------------------------------------
<servlet>
<servlet-name>SrvLog</servlet-name>
<servlet-class>ServerLog</servlet-class>
</servlet>

<servlet-mapping>
<servlet-name>SrvLog</servlet-name>
<url-pattern>/Test0005</url-pattern>
</servlet-mapping>
-----------------------------------------------------------------


Where must the servlet "ServerLog.class" reside in order for it to run?

I do not have any package statements in "ServerLog.class"

I have tried putting it in the "WEB-INF/classes" directory of "Test0005" and
calling "localhost:8080/Test0005/ServerLog" I get a 404 error.

I have tried putting it in the "Test0005" directory and I also get a 404
error.


Any ideas?

Regards,

PJ
 
A

Arnaud Berger

Hi,

Does "localhost:8080/Test0005/SrvLog" give 404 also ? (typo suspected)

You should replace your "url-pattern" with "/SrvLog" I think.

Regards,

Arnaud
 
A

Arnaud Berger

Me again,

The class should really be in "WEB-INF/classes" for this to work.

Arnaud
 
A

Arnaud Berger

Hi,

Is Test0005 the name of the webapp ?

You may compare your webapp conf with the one of the "examples" webapp you
probably have in tomcat

Arnaud
 
P

PJL

PJL said:
Using Tomcat 4.1.30 on Win XP Pro

Given the following:
-----------------------------------------------------------------
<servlet>
<servlet-name>SrvLog</servlet-name>
<servlet-class>ServerLog</servlet-class>
</servlet>

<servlet-mapping>
<servlet-name>SrvLog</servlet-name>
<url-pattern>/Test0005</url-pattern>
</servlet-mapping>

url-pattern should be "/ServerLog", I guess it is based on the notion that
the "ROOT" is "Test0005" which is the directory under the "..../webapps"
directory. So, "jakarta-tomcat-4.1.30/webapps/Test0005" is the actual root
path of my website.

Couldn't see the forest for trees on that one.

I'm a newbie, can you tell??

Thanks all,

PJ
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,431
Messages
2,571,677
Members
48,796
Latest member
Greg L.

Latest Threads

Top