Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problems with the web.xml !!!

Status
Not open for further replies.

MartinLS

Programmer
Feb 6, 2004
1
CA
Like a lot of other programmers, I have proble with running Servlet with Tomcat. Here is my configuration:

The name of the directory for my application is:
test

classes are in:
webapps\test\WEB-INF\classes\visit1\ServletVisit1.class
where visit1 is the package.

my web.xml is:
<web-app>
<servlet>
<servlet-name>servletvisit1</servlet-name>
<servlet-class>visit1.ServletVisit1</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>servletvisit1</servlet-name>
<url-pattern>/servlet/ServletVisit1</url-pattern>
</servlet-mapping>
</web-app>

I'm calling with the following URL:
/servlet/visit1.ServletVisit1

and I received the famous The requested resource (/servlet/visit1.ServletVisit1) is not available.

Is somebody knows what is possibly wrong with this ?
I'm not an expert at all with all this stuff so, it's possible that I forgot something very simple but any help will be helpful,
Thank you in advance.
 
You have mapped the servlet to the url pattern &quot;/servlet/ServletVisit1&quot; but you are calling it with &quot;/servlet/visit1.ServletVisit1&quot; - which is not a valid mapping according to your web.xml file.

Try using the pattern &quot;/servlet/ServletVisit1&quot;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top