• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

how servlet is calling here

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

cheers,
babu.
 
reply
    Bookmark Topic Watch Topic
  • New Topic