Servlet technology and JSP technology are two main technologies used to develop Web applications using Java language. In 1996, Sun released Servlet technology for the first time to solve the performance problems in Web applications. When the Servlet
Recently, I encountered a small requirement. I want to set the resultType returned by some actions to freemarker by default. I first wanted to configure the global result on the action, and then use an expression for the name, and then type =
Java. lang. nullPointerException at org. apache. jsp. index_jsp. _ jspInit (index_jsp.java: 22) may be caused by many reasons. The most important reason is that the jar package in your project conflicts with the jar package in release, many
1. inherit the AbstractInterceptor class or implement the interceptor interface. Because AbstractInterceptor is the implementation class of interceptor, the general methods in the interface are implemented, but they are used to inherit
[Html] --> /Namespace. jsp /Namespace. jsp www.2cto.com description: the package is equivalent to the java package, struts. multiple packages with different names can exist in xml. [html] extends is equivalent to the inheritance
JSP script elements: expressions, Scriptlet. The conceptual expression of the Declaration expression represents data, the system calculates and displays the expression as a value on the JSP page. Demo code: [html] jsp expression demo JSP
1. mysql limit keyword (DAO)
Select * from tablename limit startPoint, numberPerPage;
Tablename is the name of the table to be displayed by page;
StartPoint is the starting position-1;
NumberPerPage is the number of entries displayed on a
Note: When learning to use the selvert filter to process Chinese garbled characters, UTF-8 is used to process Chinese garbled Characters During filter configuration initialization, while gbk is used in the submitted jsp page. Although the two types
JavaServer Faces (JSF) is a new standard Java framework used to build Web applications. It provides a component-centric method for developing Java Web user interfaces, which simplifies development. JavaServer Faces has also aroused the interest of
Struts2 does not provide its own request parser. That is to say, struts2 does not process multipart/form-data requests by itself. It needs to call other request Resolvers, parse the form fields in the HTTP request. However, struts2 further
// Note: Chinese file names such as "target page. jsp" are not recommended.
1. response jump:
// Jump with session and without request (client jump)Responst. sendRedirect ("target page. jsp ");
2. forward jump:// Jump with session and request
Struts2 provides both a convenient file upload mechanism and a convenient File Download mechanism.
1. (1) Check the SteamResult class.
Need to be configured in strut. xml
(2) The two circles correspond to each other.
(3) test Download Page
DispachAction is a dynamic specified Action. That is to say, different request and url parameters at the view layer are intercepted by ActionServlet,
And in the struts-config.xml according to the request to get different parameters to specify (CALL)
, Configure the Action wildcard (wildcard)
Use wildcards to minimize the configuration quantity. However, you must abide by the principle that "conventions are better than configurations ".
1. wildcard characters
Asterisk (*) indicates all
{Number}
Because the application object is used to complete the accumulative functions, when (1) the current Wen application is redeployed (2) the Tomcat server restarts the counter and starts counting again. The jsp code is as follows:
Insert title
Simply put, these three methods encapsulate some common functional methods to normalize these methods, avoiding repeated and fragmented compilation of similar code in jsp development. In other words, struts2 is responsible for processing customer
Absolute path of the Windows operating system: the path starting from the drive letter, such as the relative path of C: \ windows \ system32 \ cmd.exe: The Path starting from the current path, for example, the current path is C: \ windows: To
The problem encountered in reality is: Export EXCEL 1. Use UTF-8 encoding only output header, no output data, garbled; when there is data output, it will not garbled. 2. Use GB2312 encoding output with the UTF-8 on the contrary, there are data
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.