Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

How to set up context in Tomcat 5.0?  RSS feed

 
Jack Davis
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, I've installed Tomcat 5.0 and I'm having difficulty setting the context for my servlets. I was recently using the JWSDP setup - which I found more simpler - all I did for that was create a new folder under webapps, then a folder called WEB-INF, then classes, plus the web.xml file. When I try this for Tomcat 5.0 it gives me problems. I've also tried seting up servlets through the admin section but the same problem occurs. Btw it does recognise the folder name but it won't acknowledge the URL patern, even though the web.xml has been correctly configured.
Any ideas where I'm going wrong?
 
Billybob Marshall
Ranch Hand
Posts: 202
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'd think before you'll get any help (not promising it'll be me) it might help to show what's in your web.xml and clearly show the directory structure. Basically you're saying you've done everything right (but not showing what it is) yet something's wrong, so everyone's supposed to read your mind and figure it out.
 
Jack Davis
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
the xml file is as follows......
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE web-app
PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app>
<servlet>
<servlet-name>bob</servlet-name>
<servlet-class>RequestServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>bob</servlet-name>
<url-pattern>/hello</url-pattern>
</servlet-mapping>
</web-app>

The setup is as follow.....
C:/Tomcat/webapps/HelloMidlet/Web-inf/classes
 
James Swan
Ranch Hand
Posts: 403
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Long shot maybe (or not), but perhaps you have to declare your servlet in a specific package as opposed to just the default package. I remember hearing about this but can't recall the situation.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!