This week's book giveaway is in the Mac OS forum.
We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line!
See this thread for details.
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes Not able to get  the concept of Mapping a request URI to a servlet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "Not able to get  the concept of Mapping a request URI to a servlet" Watch "Not able to get  the concept of Mapping a request URI to a servlet" New topic
Author

Not able to get the concept of Mapping a request URI to a servlet

deepa nari
Greenhorn

Joined: Nov 05, 2002
Posts: 20
In book swcd certification by Hanumant Desmukh
Iam not able to understand the concept on page 77 Table 5.2 Mapping a request URI to a servlet...
Please i request anybody to clarify it.
Say for example if i say
I have HelloSevlet in http://localhost:8080/examples/servlet/HelloServlet
What is the request URI, Servlet Used , Servlet Path , Path Info??
deepa nari
Greenhorn

Joined: Nov 05, 2002
Posts: 20
on page 77
Request URI
/color/red
ServletUsed
RedServlet
ServletPath
/red
PathInfo
null
and
Request URI
/colorapp/blue
Servlet Used
NONE
(ERROR MESSAGE)
Why is servlet used none do we have to name the servlet
isnt the servletpath blue and path info null for the /color/blue
Rasika Chitnis
Ranch Hand

Joined: Jun 19, 2001
Posts: 131
I very much agree with you. I found servlet mapping and uri mapping for .tld file (sections 5.2.3, 5.2.4 and
15.2.1 to 15.2.4) to be most confusing.

Given that the sub elements <servlet> and <servlet-mapping> of
<web-app> element are optional, (see the definition of <web-app> element given on page 87), what if I write
a servlet for my web application, but do not declare it in web.xml ? Can this servlet still accessible using
exact servlet name ?
On page 72, it says that the us-sales servlet can be accessed through the URL,
http://www.myserver.com/servlet/us-sales. Why /servlet is necessary ? In fact,
isn't context path i.e web application name missing in this ?
On page 77, how servlet path /red match /red/*, if /blue does not match /blue/ ?
On page 284, table 15.1, it says that we can use absolute URI for uri attribute in taglib directive
e.g. http://www.manning.com/taglibs. But, on page 289, it says 'If the specified uri attribute is an
absolute URI, then it is an error and is reported at translation time.'
Any thoughts on above points ?
thanks
 
GeeCON Prague 2014
 
subject: Not able to get the concept of Mapping a request URI to a servlet