Block JSP pages and verify that they are logged in
Recently using STRUTS2 to do projects, you need to intercept the JSP to verify that it has been logged, but the STRUTS2 filter chain can only filter action. Later found in the web.xml can directly
The JSP compiler guidelines and instruction components have five types. After JSP1.0, most of the JSP is contained in a single tag that ends. The new JSP1.1 specification has been published and is also compatible with XML.
The compiler guidelines
The servlet has a very interesting and useful function, that is, filter. The so-called filter is a small program that executes before a user requests to the servlet, or after the servlet executes, to preprocess a user request, or to do some public
Entity Bean defined in JSPclu" class= "Cn.domain.CacluBean" >CLU" > Gets the Bean's property value and outputs the value to the page;
El expression : ${entity object name}When an El expression takes data, a. Number is usually used, and.
Today there is nothing, suddenly think of a problem, can access the suffix of JSP file to my own suffix it? After some of their own debugging, finally succeeded. Hahaha. So happy ...First of all, configure in WEB.XM.testsuffixmytest.
In JSP, we often read data from the database back to the client, but we often in the production of garbled phenomenon, so we can use this method to ensure the correct output of Chinese, Here's an example,
Before we catch the value of the form or
Recently did the project encountered a problem, obviously added Response.sendredirect (), the system also implemented, but it is not jump; finally find the reason on the Internet as follows:
First of all, we need to understand the principle of
Fusioncharts free Download Address: http://www.fusioncharts.com/goodies/fusioncharts-free/
Next in the JSP page to introduce JS
Copy Code code as follows:
And then write
Copy Code code as follows:
The
1. Write a tag processor class that implements tag interface
Copy Code code as follows:
Package Cn.itcast.web.tag;
Import java.io.IOException;
Import Javax.servlet.http.HttpServletRequest;Import javax.servlet.jsp.JspException;Import
Because the JSP code specification requires no Java code to appear. All of them have a custom label technology for JSP.
Therefore, the JSP's custom label technology is to remove the JSP in the Java code. At the same time, packaging label personal
If the page in the jsp:include is garbled, you need to add the in the page that uses the
Request.setcharacterencoding (' UTF-8 ');/or specified encoding (GBK or other)%>As shown in the following:
Copy Code code as follows:
jsp-include.
Use Ajax to refresh JSP content in a div
Copy Code code as follows:
If you let this div automatically refresh, you can use SetInterval (' Startrefresh () ', 5000), which is the function of automatically performing a Startrefresh
First, write a hyperlink somewhere on the page you're logged on to:
Copy Code code as follows:
Exit
Let it link to the exit.jsp page, and then create a new exit.jsp page to write the following code in its body:
Copy Code code
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.