File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

difference between javax.servlet and javax.servlet.http

 
david allen
Ranch Hand
Posts: 185
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,
I am just after a brief description on what is the difference between javax.servlet and javax.servlet.http (very general and simple).
If someone could please tell me that would be great.
David
 
david allen
Ranch Hand
Posts: 185
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I might just reword my question. I know that servlethttp extends servlet but would you ever want to use servlet directly or you would always use servlethttp.
thanks
david
 
Dani Mazzuca
Ranch Hand
Posts: 70
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
First af all, Servlet is an interface, and HttpServlet is a class.
In general javax.servlet package has all the classes/interfaces not directly tied to HTTP, and java.servlet.http package has the classes/interfaces that deals with the http protocol.
If you are going to use HTTP, you should extend the class HttpServlet (wht you normally do). If you are not going to use HTTP, you can extend just GenericServlet, that implements the generic interface Servlet, but it is not tied to HTTP.
Dani
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic