tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Georg Sauer-Limbach <g...@gslweb.de>
Subject Re: (newb) Tomcat servlet mapping problem
Date Mon, 23 Jan 2006 23:12:22 GMT
Darren Hall wrote:

> (I wasn't sure how to configure the ResourceBundle in the code. I copied all
> the files the resource bundle seemed to be referring to into my /servlet
> directory along with the compiled HelloWorldServlet code, but it still
> complained on execution that it couldn't locate the resource, so it was
> easier for me to comment it out.)

Better forget about the /servlet url|directory.
It was only a made-up url segment for the invoker.
In production environments, never use that, but
explicit Context paths.

Put your servlet.xml (or whatever named, better
name it something like myapp.xml) in place again,
using a nice Context path.

After that, you can put all your servlets with
no package in WEB-INF/classes. This will also
be the place where your resource bundles will
be found.

Then, these mappings are perfectly alright:

> <web-app>
>   <servlet>
>     <servlet-name>FLCUpEvDisplayServlet</servlet-name>
>     <servlet-class>FLCUpEvDisplayServlet</servlet-class>
>   </servlet>
>   <servlet-mapping>
>     <servlet-name>FLCUpEvDisplayServlet</servlet-name>
>     <url-pattern>/FLCUpEvDisplayServlet</url-pattern>
>   </servlet-mapping>
> </web-app>


> Now everytime I hit the servlet, I get the "ClassDefNotFound" error, and
> after that I see an entry in the log file:
> 
> 2006-01-23 11:35:53 StandardContext[/servlet]Marking servlet
> FLCUpEvDisplayServlet as unavailable
> 2006-01-23 11:35:53 StandardContext[/servlet]Error loading WebappClassLoader
>   delegate: false
>   repositories:
>     /WEB-INF/classes/
> 

Hmm, you're mixing up that "/servlet" story.
Better remove everything named "servlet" from
your environment... It is only confusing.

Create app.xml, put the Context path "/"
or "/app", and then "/FCLxyzServlet" or
"/app/FCLxyzServlet" are the correct URLs.

Does that make any sense?

Georg


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


Mime
View raw message