Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

General question.

 
Rohit Kelkar
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1. Will a servlet mapping
<servlet-mapping>
<servlet-name>reportServlet<servlet-name>
<url-pattern>report</url-pattern>
</servlet-mapping>
work for http://www.something.com/report?
2. Will a servlet mapping
<servlet-mapping>
<servlet-name>reportServlet<servlet-name>
<url-pattern>/report/</url-pattern>
</servlet-mapping>
ever be useful?
Haven't tried them.
 
Vedhas Pitkar
Ranch Hand
Posts: 445
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I think the first one wont work while the second one will work.I also didnt try it out,am a bit lazy ,I guess.
 
Rohit Kelkar
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can you suggest a example for the 2nd one?
I can't think of one.
 
R K Singh
Ranch Hand
Posts: 5388
1
Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
http://www.yourDomainName.com/yourServletContext/report/someURI should call *reportServlet*
CMIW
 
Rohit Kelkar
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Tried both of them and both of the mappings did work. I cannot think of any explaination why those worked !!!
 
yi zhu
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The first one does not work (with Tomcat)!
 
What are you doing? You are supposed to be reading this tiny ad!
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!