Please send your Questions & Answers or Feedback to ""

Difference between session and context object ?

Session object is created for a specific request and the values in it are accessible within that request whereas Context object is created for web application and the values in it  will be accessible for all requests and accessible across the application.

Why request object is created per request not reused ?

Request object is created per request not reused because HTTP is a stateless protocol and it does not expect the data to be remembed. But the servlet object is created once not per reuest.

If different request comes from different browsers it creates different request threads rather than different servlet objects.

Can we write static methods in a servlet?

We do not see any static methods in the servlet as the container has to create the servlet class object.

What is the Servlet?

A servlet is a Java programming language class that is used to extend the capabilities of servers that host applications accessed by means of a request- response programming model.

What are the new features added to Servlet 2.5?

Following are the changes introduced in Servlet 2.5:
A new dependency on J2SE 5.0
Support for annotations
Loading the class
Several web.xml conveniences
A handful of removed restrictions
Some edge case clarifications
Related Posts Plugin for WordPress, Blogger...
Flag Counter