Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

configuring servlets on tomcat4

 
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
i have tried that
but it still gives me
description The requested resource (/test/servlet/HelloWorldExample) is not available.
 
Ranch Hand
Posts: 3695
IntelliJ IDE Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
Please don't cross post

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

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