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

15y 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.


What is a JSP implicit object?

A JSP implicit object is a predefined object available in JavaServer Pages (JSP) that provides access to various objects related to the web application environment. These objects, such as request, response, session, and application, allow developers to interact with client requests, manage session data, and share application-wide information. Implicit objects simplify coding by eliminating the need to explicitly instantiate and manage these objects, enhancing the ease of developing dynamic web content.


How you can use session variables in your application in asp net 3.5?

In ASP.NET 3.5, session variables can be utilized to store user-specific data across multiple pages within a web application. You can access the Session object through Session["VariableName"] to set or retrieve values. For example, to store a username, you would use Session["Username"] = "JohnDoe";, and to retrieve it, you would use string username = (string)Session["Username"];. Ensure to manage session state properly to avoid excessive memory usage and to handle session expiration appropriately.


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)


What is session and how it is create in asp dot net?

In ASP.NET, a session is a server-side storage mechanism that enables the storage of user-specific data across multiple requests during a user's session with a web application. A session is created when a user first accesses the application, and a unique session ID is generated and sent to the client as a cookie or through the URL. Developers can store and retrieve data in the session using the Session object, allowing them to maintain state information, such as user preferences or authentication details, throughout the user's interaction with the application. Sessions typically expire after a specified period of inactivity or when the user explicitly logs out.


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


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 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.