Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

GenericServlet and HttpServlet

 
Rajpal Kandhari
Ranch Hand
Posts: 126
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Everyone,
Could anyone explain me the following:

1. diffrance between GenericServlet and HttpServlet?

2.To invoke a servlet (assuming that server is on local machine) we use the following URl.
http://localhost:8080/servlet/servletfilename
I am told that 8080 is the communication port. Is this right? Or there is more in this?
What dose "servlet" mean in the above URL?
Thanks
Raj.

------------------
 
Tony Alicea
Desperado
Sheriff
Posts: 3226
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The difference between GenericServlet and HttpServlet is that the first one is an abstract class and the second one is an implementation of the first one. The abstract GenericServlet also implements the interfaces Servlet, ServletConfig and Serializable
8080 is not a sacred number. You can configure it to be anything.
/servlet lets the server know that it's a servlet that has been requested. It is not absolutely needed. You could as easily have http://localhost:8080/servletfilename
It's all configurable depending on your server.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic