File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes need help! 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 "need help!" Watch "need help!" New topic
Author

need help!

MInu
Ranch Hand

Joined: Oct 09, 2003
Posts: 517
Hi...

what is the meaning of this type of url definition.

<url-pattern>/name/*</url-pattern>

Thanks


God Gave Me Nothing I Wanted<br />He Gave Me Everything I Needed<br /> - Swami Vivekananda
MInu
Ranch Hand

Joined: Oct 09, 2003
Posts: 517
Got answer....


If we want to use path prefix mapping, we
have to do like this:


code:
________________________________________________________________
<servlet-mapping>
<servlet-name>myServlet</servlet-name>
<url-pattern>/sth/*</url-pattern>
</servlet-mapping>


________________________________________________________________
Does that mean we can map to myServlet like this now?

http://localhost/sth/whatever
Anand Wadhwani
Ranch Hand

Joined: Mar 21, 2005
Posts: 151
Very well yes!

The url-pattern defines the virtual name for your servlet class. This name would appear in the URL which in turn appears to client of your website. So this is a good way of hiding your actual servlet class name from client. At the same time it gives to ability to define virtual (logical) directories appearing in URL which are not actual directories on your server!

Also please note that you cannot invoke your servlet without mapping to a url-pattern. It's mandated by container!

Hope this helps.


SCWCD 1.4<br />---------------------<br />Ability is what you're capable of. <br />Motivation determines what you do. <br />Attitude determines how well you do it.<br />---------------------
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: need help!