• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Why should the URL have /servlet/

 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When running servlets , i have to mention the URL as
http:\\localhost:8080\servlet\MyServlet
why and how does the jsdk take it the URL with /servlet/ .
Is there any documentation regarding this /servlet/ stuff.....
Or is just a convention followed by jsdk and java web sever?
any answers to this?
Thanks
 
John Bateman
Ranch Hand
Posts: 320
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
It's not the JSDK that takes this url, it's the servlet engine that recognises it in the URL and 'knows' that it should kick in and look for, and run, a servlet.
It's like using a 'variable' /servlet/ that points to the servlet classpath in the servlet engine, NOT the OS. You could make that 'tag' anything like http://www.server.com/theNextWordIsAServlet/HelloWorldServlet.
It's important to remember that the /servlet/ doesn't really mean a 'subdirectory' but is a 'flag' for the servlet engine.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic