Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
    Bookmark Topic Watch Topic
  • New Topic

configuring servlets on tomcat4

 
prasad hagargi
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
  • Report post to moderator
hi,
Can anybody guide me in configuring servlets in a new context other than the examples context ,
on tomcat4.
when i try to invoke a servlet, file not found
exception is occurring.
the structure of the web.xml is like this
<servlet>
<servlet-name>HelloWorldExample</ervlet-name>
<servlet-class>HelloWorldExample</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>HelloWorldExample</servlet-name>
<url-pattern>/HelloWorldExample</url-pattern>
</servlet-mapping>
 
prasad hagargi
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
  • Report post to moderator
the servlet mapping for "invoker" servlet in web.xml in tomcat/conf directory is uncommented
and should i add a new context tag in the server.xml,if yes where and what should be its syntax
 
Dinesh Ramaswamy
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Report post to moderator
If u give the url as
"http://localhost:8080/myWkgFolder/servlet/HelloWorldExample",
then the <servlet> tag is enough.
There is no need for <servlet-mapping>.
Important thing is we must give in the url :
servlet/HelloWorldExample.
 
prasad hagargi
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
  • Report post to moderator
i have tried that
but it still gives me
description The requested resource (/test/servlet/HelloWorldExample) is not available.
 
Mike Curwen
Ranch Hand
Posts: 3695
IntelliJ IDE Java Ubuntu
  • Mark post as helpful
  • send pies
  • Report post to moderator
Please don't cross post

http://www.coderanch.com/t/82167/Tomcat/configuring-servlets-tomcat

And also.. *don't* use the /servlet/* mapping.
 
    Bookmark Topic Watch Topic
  • New Topic