JSP html CSS JS MySQL to do Library Management system learning experience

Source: Internet
Author: User
Tags server memory

Session

1) How to use

A JSP document: <%session.setattribute ("name", value):

In addition JSP document: <%string str = (String) session.getattribute ("name"); note the return value is an object

2) Description

Session

Session represents a client-to-server conversation. (Open the browser from the client and connect to the server to start, to the client close the browser to leave the end of this server, known as a session.) )
The session in the Web refers to the amount of time that a user has spent browsing a website, from entering the website to the browser closing, that is, the time it takes for the user to browse the site.
As can be seen from the above definition, the session is actually a specific time concept in the server memory of the session,session of different users and the user is one by one corresponding.

Session object:

· is an object that is used to store each user's information separately to keep track of the user's operational status.

The session information is stored on the server side.

The session object is a JSP built-in object.

The session object is created automatically when the first JSP page is loaded, and sessions management is completed.

When a client accesses a server, it may switch between several pages of the server, and the server should know by some means that it is a client and needs a session object.

3) Destruction:
There are only three ways to destroy a session:
1. Call the Session.invalidate () method
2.session expired (timed out)
3. Server restart

The Tomcat default session time-out is 30 seconds.
There are two ways to set the session time-out:
1.session.setmaxinactiveinterval (time);//Unit is seconds
2. Configuring in Web. xml
<session-config>
<session-timeout>
10
</session-timeout>
</session-config>//Unit is minutes
(Note: the Web. XML document is in the Web-inf directory of the Project)

2.include instruction

<@ include file = "path to jsp.html files > Loading an interface into this document, making header documents

3.tomcat Boot Duration

Modify the XML file parameters under the E:\javaswing\.metadata\.plugins\org.eclipse.wst.server.core folder

4 Exiting the System

1) Exit and logout connections are placed in the top window

2) processing the page

Out.println ("<script language= ' JavaScript ' >alert (' Are you sure you want to log off? ‘);" + "window.top.location.href=". /login/login.jsp ';</script> ");

3) Not yet understood--------------------------there are caching issues

<script language= "JavaScript" >
Top.opener=null;
Top.close ();
</script>

JSP html CSS JS MySQL to do Library Management system learning experience

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.