|
For example, a bulletin board application groups pages for article reading, group listing, user registration, and new article posting into a single application. Applications can keep track of user sessions, giving the users the illusion of a single application out of disjoint pages. Many, if not most sites, will only use the default application.
Java Beans get first class treatment in JSP 1.0. Beans can be created for a page, across a session, or for the entire application. The classes and lib directories can contain application beans used by jsp:useBean. These are simply Java classes implementing the bitmechanic work of an application. For example, a shopping cart application may have a set of Java classes that perform the security necessary for credit card processing. The application can put those classes in the beans directory and access them from the JSP page. Beans can be created with different lifetimes. JSP assigns the created bean object to the
In addition, the created beans are stored in JSP variables: page beans are stored in request, session beans are stored in session, and application beans are stored in application. Storing the beans in the JSP variables lets other beans and functions retrieve the beans.
JSP sessions start when the page accesses the session variable. If a page never uses sessions, the jsp:session:onStart code will not execute and the web server will not send the client any cookies. Sessions end when the session times out, when the session is invalidated, or when the application ends.
| |||||||||||||||||||||||||||||||||||||||||||||||