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 =
Insert title here total website visits: $ {totalCount} www.2cto.com: $ {count} by body /* session. getAttribute ('Count') corresponds to var = "count" scope = "session" *//* application. getAttribute ("totalCount ") corresponds to var =
In jsp, if you need to process complex data, defining a java method above is a very effective solution, and pushing the responsibility for processing data to this method, then the main process of the jsp page will not be affected. Of course, you can
Integration of Struts2 and Spring: 1. add jar package (note package conflict), also need to note must be added to the struts2-spring-plugin.jar package 2. add support files (struts. xml and applicationContext. xml) 3. configure web. xml (1)
The jump between actions in Struts2 can be divided into two parts, one is the jump between actions in the same package, and the other is the jump between actions in different packages. Whether it is in the same package or not, you must first make it
1: The property value in the output action is displayed on the jsp page with: 2: to automatically add sequence numbers on the page, use the index attribute eg: // inOoutAccountList must have the getting and setting methods 3: Obtain the
The purpose of EL is to aid producing scriptless JSP pages
Syntax of EL in a JSP page :$ {expr}You can escape the expression:\ $ {Expr}
Username: Password:
$ {Param. username}$ {Param. password} -->
Beans within the namespace avaiable to the JSP
Many php users do not understand the differences between 0, "", null and false in php. These differences sometimes affect the correctness and security of data judgment and cause a lot of trouble for program testing. So we must take a good look at
Set read-only
Document. getElementById ("projcode"). setAttribute ('readonly', true );
Press the backspace button and stop at the original page.
Document.doc umentElement. onkeydown = function (evt ){Var B = !! Evt, oEvent = evt | window.
This function is better when there are many Struts configuration files that need to be divided or separated into multiple configuration files.
Use the label to introduce other configuration files to the Struts. xml configuration file.
For example,
[Html]
1. Add jstl support to the following code on the jsp page
2. If the jsp page reports the following exception
Org. apache. jasper. JasperException: java. lang. ClassNotFoundException: org. apache. jsp. Customer. addCustomerInfo_jspOrg.
1. Comparison of the Action Implementation class: Struts 1 requires the Action class to continue with an abstract base class; a specific problem of Struts 1 is the use of abstract class programming rather than interfaces. Struts 2 Action class can
Built-in object features:
1. It is provided by JSP specifications and does not need to be instantiated by writers.
2. Web Container Implementation and Management
3. All JSP pages can be used
4. It can only be used in the expression or code segment
First, let's talk about how repeated submissions are generated. Generally, there are two ways: 1. Refresh the page after page submission. 2. Click the submit button multiple times during submission. In strut1.x, the solution to prevent submission 1
In the page or background response, directly add your file with the file header and write the file stream. For example, if you write on a page like this, you 'd better write it in the background: "> My JSP 'test. jsp 'starting page -->
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
1. Create a javaweb project and copy the struts jar package to WebRoot/WEB-INF/lib.
2. The jar package cannot be copied. the user's request must reach the ActionServlet before processing the request through struts. Therefore, the ActionServlet
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