• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Q about Servlets (1): how does the server recognize request?

 
Gian Franco
blacksmith
Ranch Hand
Posts: 979
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

How does a server recognize whether the client
sent a request for an HTML page or a servlet?
Is it simply done by checking the file extension
and the protocol in the URL?

Cheers,

Gian Franco
 
Ko Ko Naing
Ranch Hand
Posts: 3178
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, it will find the path according to the user's request, if it is a JSP file... But if it is not a JSP file, it will find the servlet mapping section in the web.xml and try to find one servlet to take care of the user's request. If it cannot find, then an error is generated or forward to the default servlet...

Hope it helps...
 
Consider Paul's rocket mass heater.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic