This week's book giveaway is in the OCAJP forum.
We're giving away four copies of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) and have Khalid A Mughal & Rolf W Rasmussen on-line!
See this thread for details.
Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Basic doubt on sevlets

 
Vinod Chamoli
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Could any one of u pls explain me like what is the difference between
Generic servlet and Http servlet?
Thanks inadvance
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13071
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The javax.servlet package provides only the service method which is not tied to a particular protocol.
If you want to write a servlet that can respond to browser requests, use the javax.servlet.http package HttpServlet as a base.
 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
U use sevice method o.k.My dout is how to call servlet from browser side.Can we use any proocol like ftp://www.servlet.com:21/servlet/...? Please clearify it.
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13071
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Java servlets run in the context of a web server, Sun calls it a "Servlet container" - so how you address them depends on the web server. FTP protocol is something entirely different and doesn't go through a web server AFAIK.
With something like the Tomcat server you would send your browser to a URL
http://yourserver/servlet/servletalias
where the server maps servletalias to your servlet class.
 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Then, How can i call a protocol independent servlet without/with a browser.
Thanks inadvance.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic