• 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

difference between javax.servlet and javax.servlet.http

 
Ranch Hand
Posts: 185
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
reply
    Bookmark Topic Watch Topic
  • New Topic