Logo 
Search:

Java Forum

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds

Tomcat

  Asked By: Maria    Date: Oct 17    Category: Java    Views: 654
  

I NEED help in using Tomcat. I am testing my fisrt servlet.
I did all the step but when i type the url the swervlet doesn't run.
I give you some other information:

so: XP HOME

JAVA_HOME
C:\j2sd1.4.1_01
J2EE_HOME
c:j2sdkee1.3.1
CATALINA_HOME
C:\jakarta-tomcat-4.1.26



my web.xml file is

<web-app>
<servlet>
<servlet-name>name</servlet-name>
<servlet-class>hello</servlet-class>
</servlet>
</web-app>


I put my servlet in a dir named hello
\webbapps\hello\
\WEB-INF\web.xml
\classes\hello.class

I heve NOT error at the start-up
but when I type the URL
http://localhost:8080/hello
the servlet is not execute

What have I to do yet?

Share: 

 

1 Answer Found

 
Answer #1    Answered By: Daniel Jones     Answered On: Oct 17

I think you missed the servlet-mapping part in your web.xml.

Your web.xml should be something like this:


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

 
Didn't find what you were looking for? Find more on Tomcat Or get search suggestion and latest updates.




Tagged: