Sign in a li> Most web applications need Keep track of users who use the application. HTTP has some basic support for maintaining user login, but its method is very limited and unsafe. The Java Servlet Framework provides powerful support for maintenance user sessions, but there is a mechanism to be drawn by HTTP. JSessionID is a keyword for container maintenance to track users via HTTP. In a hyperlink contains a session keyword called URL rewrite. Servlet specification [Sun, JST] encourages the use of cookies to maintain sessions. When this method does not pass, you can use the URL rewriting instead. The browser does not know if the browser accepts cookies when the browser requests the container. So the container can send a cookie to the browser, but does not tell it whether it is also accepted next time (HTTP does not "handshake.") At the same time, the response to the current request must be output. So, the first page facing the browser usually needs to be rewritten using the URL. If later requests, the container finds that the browser can accept cookies, which can skip URL rewrite.
2,
produces a standard HTML Base tag to pair the address of this JSP page for reference to this JSP page. You may notice sometimes the Logon app references to the .do page. This is not a page file on the actual server, but a Java class written by the developer, or a reference to the action. These Actions are then forwarded to the JSP page created by the response. JSP usually includes reference to HTML resources such as pictures and style sheets. The most convenient way is to reference through the path relative to the JSP template. But when Action is forwarded, it does not inform the browser in advance. If the browser is given some relative paths, it will parse them according to the Action URI, not the position of the JSP Template. Depending on when you visit the welcome page, its address may be displayed by the browser: http: // localhost: 8080 / logon / http: // localhost: 8080 / logon / logonsubmit.do
Http: // localhost: 8080 / logon / logoff.do This is a very common problem for dynamic applications. HTML specification [W3C, HTML] provides a tag as a solution. Struts also provides a similar HTML-Base tag that can be inserted into JSP. If you view the HTML source code of the Logon page, query its appearance address, you can see that the tag is processed into: this> this> this You can let the browser find the "Powered By Struts" picture, which is also stored below the Pages folder.
3,
Check if you store a "user" bean in the customer session