First of all, the reason JSPs stop working when you uncomment the section of your application's web.xml is you have overriden the default servlet and sent everything to HelloWorldExample:
<servlet-mapping>
<servlet-name>HelloWorldEx
<url-pattern>/</url-patter
</servlet-mapping>
Which is saying for every request location beginning with "/" (in other words, all of them) send them to HelloWorldExample servlet.
What you are overriding is some settings in $TOMCAT/conf/web.xml:
<!-- The mapping for the default servlet -->
<servlet-mapping>
<servlet-name>default</ser
<url-pattern>/</url-patter
</servlet-mapping>
<!-- The mapping for the JSP servlet -->
<servlet-mapping>
<servlet-name>jsp</servlet
<url-pattern>*.jsp</url-pa
</servlet-mapping>
<servlet-mapping>
<servlet-name>jsp</servlet
<url-pattern>*.jspx</url-p
</servlet-mapping>
So, looking at your proxy config and jsp include, it looks like what you want in your application's web XML is probably something like:
<servlet-mapping>
<servlet-name>HelloWorldEx
<url-pattern>/HelloWorldEx
</servlet-mapping>
Second, can you clarify "to serve a servlet from /home/lennart/www/blog/tes
Is that last path segment a directory name? In other words, do you have a class file like:
/home/lennart/www/blog/tes
If so, then your servlet-class should reflect that. In other words:
<servlet>
<servlet-name>HelloWorldEx
<servlet-class>HelloWorldE
<load-on-startup>1</load-o
</servlet>
Main Topics
Browse All Topics





by: fargoPosted on 2006-04-23 at 10:33:14ID: 16519917
it is recommended to keep the servlet or any other java classes in under WEB-INF/classes with packages.
WorldExamp le and do adjust the servlet-class in the web.xml with packages.
ample</ser vlet-name> ample</url -pattern>
For ex: the class HelloWorldExample should go under some package say for ex: com.company.servlets.Hello
do check the url pattern..it should have the same name for your case.
<servlet-name>HelloWorldEx
<url-pattern>/HelloWorldEx
restart the tomcat and things should work.