aspose file tools*
The moose likes Servlets and the fly likes how servlet is calling here Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "how servlet is calling here" Watch "how servlet is calling here" New topic
Author

how servlet is calling here

A Babu
Ranch Hand

Joined: Nov 28, 2005
Posts: 114
hi all,
i have index.html which is in the context root.that is mentioned below.how it recognises the servlet which is in web-inf/classes folder,although i mentioned the servlet in web.xml.
I mentioned only anchor elment and give the url pattern as parameter to anchor tag.how it is doing such a great task.I want some help regarding this confusion.plese help me.



cheers,
babu.
[ January 11, 2006: Message edited by: Bear Bibeault ]

Thanks,
www.Admakr.in
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14687
    
  16

If you could please post your servlet mapping too, this would help. (the <servlet-mapping> tag in web.xml)
The url you have set in your anchor matches one of your servlet mapping in web.xml.

So when you click it, the request is transmitted to your web container, which will look for a valid mapping, which is defined in web.xml. <servlet> and <servlet-mapping>


[My Blog]
All roads lead to JavaRanch
A Babu
Ranch Hand

Joined: Nov 28, 2005
Posts: 114
A Babu
Ranch Hand

Joined: Nov 28, 2005
Posts: 114
The url you have set in your anchor matches one of your servlet mapping in web.xml.

So when you click it, the request is transmitted to your web container, which will look for a valid mapping, which is defined in web.xml. <servlet> and <servlet-mapping>


my confusion is why container look in the web.xml for the anchor tag.
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14687
    
  16

Originally posted by babu amara:

my confusion is why container look in the web.xml for the anchor tag.


It does not look for the anchor tag.
When clicking on the tag "the url set in the anchor tag" (which means 'myservlet' in your example ) is sent in the request. The container grabs the request and search is "the url" is mapped to a servlet.

The anchor tag is an HTML thing. No relation with the container.
A Babu
Ranch Hand

Joined: Nov 28, 2005
Posts: 114
hi Satou kurinosuke,
thanks friend,now i am clear.I got the concept behind this.

cheers,
babu.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how servlet is calling here