• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how servlet is calling here

 
A Babu
Ranch Hand
Posts: 114
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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>
 
A Babu
Ranch Hand
Posts: 114
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
 
A Babu
Ranch Hand
Posts: 114
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 114
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi Satou kurinosuke,
thanks friend,now i am clear.I got the concept behind this.

cheers,
babu.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic