1.5 create a deployment description file. · Register for your servlets and create a url mapping· Register and specify listeners and filters in the Application· Specify the initialization parameters in the context.· Configuration error page and
1. Integrate Struts2A) import the struts jar packageStruts2-core-2.1.6.jar xwork-2.1.2.jar ognl-2.6.11.jar freemarker-2.3.13.jar commons-logging-1.1.jarB) copy the struts. xml file to the src directory.C) configure the struts core filter in web. xml.
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 =
[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
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)
Obtain the request, session, application, HttpServletRequest, HttpSession, and HttpServletApplication of the Map type.
Method 1: Obtain Map-type request, session, and application in Action based on the container
Public class LoginAction1 extends
1. Obtain the Request Parameters and recode them.
[Java]// Obtain Request ParametersString name = request. getParameter ("name ");Byte [] bytes = name. getBytes ("ISO-8859-1"); // splits the request statement into byte arrays using a
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
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.
[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.
First, we need to write an action in struts2.
/Index. jsp
// First, the package is a package. The name in the action is a custom name, the class is a class name written by yourself, and the method is the method you want to call. Then, use the
When submitting a form, we often need to verify and verify the content of the form. If it is not empty, it can be submitted. If there is a blank text box, It is not submitted and the mouse focus is obtained to the text box, therefore, we can use the
Features of built-in objects:
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
Joseph's problem is a famous one: N people are in a circle, starting from the first to report the number, M will be killed, and the last one will be killed. For example, N = 6, M = 5, and the number of the person killed is 5, 4, 6, 2, 3. The last
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.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service