answersLogoWhite

0

Session ObjectThe session implicit object is used to provide an association between the client and the server. This association, or session, persists over multiple connections and/or requests during a given time period. Sessions are used to maintain state and user identity across multiple page requests.

A session can be maintained either by using cookies or by URL rewriting. To expose whether the client supports cookies, session defines an isCookieSupportDetermined() method and an isUsingCookies() method.

Servlet Class

HttpSession

The following table summarises the most useful methods available to the session object. For more details consult the Servlet API.MethodDescriptionisNew()A session is considered to be "new" if it has been created by the server, but the client has not yet acknowledged joining the session.invalidate()Discards the session, releasing any objects stored as attributes.getAttribute(String)Retrives the object associated with the named attribute.getAttributeNames()Retrives the names of all attributes currently associated with the session.setAttribute(String, object)Sets the object to the named attribute. attribute created if it doesn't exist.removeAttribute(String)Removes the object bound with the specified name from this session.

Application ObjectThis implicit object represents the application to which the JSP belongs. JSPs are grouped into applications according to their URLs where the first directory name in a URL defines the application.

The application object contains methods that provide information about the JSP Container, support for logging plus utility methods for example translating a relative URL to an absolute path.

Servlet Class

javax.servlet.ServletContext

The following table summarises the most useful methods available to the session object. For more details consult the Servlet API.MethodDescriptiongetAttribute(String objName)Returns the object named objName or returns null if the objName does not exist.getAttributeNames()Returns an Enumeration containing the attribute names available within the application.setAttribute(String objName, Object object)Stores the object with the given object name in this application.removeAttribute(String objName)Removes the objName object from the application.getMajorVersion()Returns the major version of the Servlet API for the JSP COntainer.getServerInfo()Returns information about the JSP Container, typically, name and product version.getResourceAsStream(Path)Translates the resource URL into an input stream for reading.log(Message)Writes a text string to the JSP Containers default log file.

User Avatar

Wiki User

14y ago

What else can I help you with?

Related Questions

Define sessions in aspnet?

ASP.NET automatically creates a session for each unique browser connection to your application. You can access the session through the Session[] collection in any System.Web.UI.Page object.


Session tracking in servlet?

Each web application contains a Session that can contain data that can be commonly made available to all the parts of the web application. The Session can be accessed from both the JSP and the Servlet. Ex: The servlet contains references to the HttpRequest object. So to access the session you can do so as below: HttpSession session = request.getSession();


What is session in jsp?

Session in the JSP and Servlet context refers to an instance of the HttpSession object that contains all the information about the current user session with the web application. This can be used as a cache or temporary storage area to store values that might be required across the application.


Has your DV lottery application session timed out?

Yes, if your Diversity Visa (DV) lottery application session has timed out, you will need to start a new session and complete the application again.


How many objects are there in ASP?

There 7 types of objects in asp There are 1)application object 2)session object 3)request object 4)response object 5)server object 6)object context object 7)Error object(it is the new object included in asp 3.0)


How can you kill a an application session scope before timeout in an application at the end of a transaction with ColdFusion code?

Try: <cfset structClear(session)>


What is a source detail on a job application?

source detail


What is the correct order for the OSI layers?

All people seem to need data processing, or Please do not through sausage pizza away Application, presentation, session, transport, network, data link, and physical. or Physical, data link, network, transport, session, presentation, and Application.


How do you make object persistent?

Persistent objects exist even after the program exits. They are persistent because they reside inside non RAM memory or ROM memory. Eg: Object variables used to create for an application or an user session.


What does source detail mean on an application?

what does Source Details mean on a job application


At which OSI model layers do the application layer or upper layer protocols operate?

Application Presentation Session


The application tcp-ip layer maps to which osi layers?

The Application layer The Presentation layer The Session layer