The reason is: by default, Servlet 2.4/jsp 2.0 supports El expressions.
There are two solutions:
1. Modify the definition at the beginning of Web. xml.CopyCodeThe Code is as follows: Xmlns = "http://java.sun.com/xml/ns/j2ee"Xmlns: xsi =
Today, when I used the jstl tag library in JSP, I encountered a very disgusting problem. I remember when I took this course at school a few years ago, I have never encountered this kind of problem. It's really disgusting to see it now.
Generally,
I often see JSP beginners asking how to configure JSP, Servlet, and bean in Tomcat. So I summarized how to configure JSP, Servlet, and Ben in Tomcat, hoping to help beginners.
I. Development Environment Configuration
Step 1: Download j2sdk and
The JSP (Java Server Pages) introduced by Sun is a dynamic web page development technology executed on the server, which is based on Java technology. When executing JSP, you need to set up an engine for compiling JSP web pages on the web server. You
1. requestdispatcher. Forward ()When forward () is used on the server, the servlet engine transmits the HTTP request from the current servlet or JSP to another servlet, JSP, or common HTML file, that is, your form is submitted to. JSP, in. JSP uses
1. Add jstl support to the following code on the jsp page
Copy codeThe Code is as follows:
2. If the jsp page reports the following exception
Org. apache. jasper. JasperException: java. lang. ClassNotFoundException: org. apache. jsp. Customer.
1. Compile a tag processor class that implements the tag Interface
Copy codeThe Code is as follows: package cn. itcast. web. tag;
Import java. io. IOException;
Import javax. servlet. http. HttpServletRequest;Import javax. servlet. jsp. JspException;
If the page in jsp: include is garbled, you must add the
Request. setCharacterEncoding ('utf-8 "); // or the specified encoding (GBK or other)
%>
As shown below:
Copy codeCode: jsp-include.jsp
jsp include test page
Request.
At present, both blog forums and enterprise offices cannot do without sharing resources. By uploading files, we can share them with you to achieve extensive communication and communication among the masses. We can gain more knowledge and experience
Document directory
HttpServletRequest
HttpServletResponse
Sample program
HttpServletLet's first review the class structure diagram mentioned in the previous section:
As you can see, HttpServlet inherits GenericServlet, but it is also an
Jsp expressions:
Copy codeThe Code is as follows:
For (int I = 1; I %>
For (int j = 1; j %>
If (j %> * = } Else
%>
}
%>
}
%>
Javascript:Copy codeThe Code is as follows: 99 multiplication table
Disable cache settings on jsp pages
1. The client cache should include the following content in :Or
2. Disable caching on the dynamic web page of the server. Add a script similar to the following:Response. setHeader ("Pragma", "No-cache
When each JSP page is accessed for the first time, the WEB Container will send the request to the JSP Engine (a Java program) for processing. The JSP Engine first translates JSP into a _ jspServlet (essentially a servlet) and calls it according to
JSP built-in Object request object
The request information of the client is encapsulated in the request object, so that the client can understand the customer's requirements and then respond. It is an instance of the HttpServletRequest class.
Serial
Some examples are shown on the Internet. For a simple three-level linkage, Struts, Hibernate, and other frameworks are added. This Ajax interaction does not know how it relates to these frameworks. Why is a small Demo so big.
Today, I made a dwr +
10:35:49 org. apache. tomcat. util. http. Parameters processParameters
Warning Parameters: Character decoding failed. parameter 'id' with value' % u8BA2 % u5355 'has been ignored. note that the name and value quoted here may have upted due to the
Page jumps can be achieved in two ways: forward and sendRedirect.
Forward: it can be used in JSP pages and implemented in Servlet.Use On the jsp page. For example, to jump to userlist. jsp, you can write:
Copy codeThe Code is as follows:
Use the
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.