Win a copy of Terraform in Action this week in the Cloud forum!
  • Post Reply 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:
  • Tim Cooke
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Rob Spoor
  • Bear Bibeault
Saloon Keepers:
  • Jesse Silverman
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Al Hobbs
  • salvin francis

Servlet Mapping doesn't work in Tomcat 5.5

 
Ranch Hand
Posts: 213
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have the following servelet decleration in my web.xml


http://localhost:8080/myapp/anyjsp.jsp --- > Works fine
http://localhost:8080/myapp/simple-man --- > gives resouce not found exception.

I haven't modified any thing in other config files.

Any quick help?

Regards
 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
<servlet-mapping>
<servlet-name>hello</servlet-name>
<url-pattern>/simple-man</url-pattern>
<url-pattern>*.jsp</url-pattern>
</servlet-mapping>

Remove the fourth line in the above code it should work fine
 
Sarath Mohan
Ranch Hand
Posts: 213
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Avisesh. Its working. But when I add *.jsp entry, the /simple-man is not working and vice versa. Could any body tell me a way where I need to map all jsps to a servlet and all request to a directory.

Thanks
 
Avisesh Jain
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Why do you need to map all JSPs to a single servlet? I think your requirement is to pass the request to the same servlet from all JSPs, if that is the case then use the action parameter of the form in JSP to redirect to your servlet. See the URL mapping has to be unique u cannot map all JSPs to a single URL.
 
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
As far as I know, you can only have one url-pattern per mapping.
Try creating a separate mapping for each url-pattern.

 
Sarath Mohan
Ranch Hand
Posts: 213
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi ben,

It worked perfectly

Thanks your valuable suggestion

Cheers
reply
    Bookmark Topic Watch Topic
  • New Topic