1. request. getRequestDispatcher () is request forwarding, and a request is shared between the front and back pages;Response. sendRedirect () is a redirection, and the front and back pages are not a request.
2. RequestDispatcher. forward () is run
There are two small exceptions when the original data is transmitted to the client:
1. If you want to transfer , because it is consistent with the special symbols of jsp, you must use escape characters, 2. If you want to send comments, they will
Example 1:Simple jsp custom tag to get content:Create a jsp instance class and inherit the SimpleTagSupport class.Then implement the doTag () method of the parent classGet the content of this. getJspBody () in the label body in this method ();The
I. javaBean1. what is JavaBeanJavaBean is a Java class that follows a specific writing method. It generally has the following features:> this Java class must have a no-argument constructor> the property must be privatized> the private property must
A compressed package is obtained after the download.
Decompress the package to obtain an important one.
Use EditPlus 3 to open cms. SQL
VcD4KPHA + 0MK9qG15c3Fsyv2 + 3b/iICA8L3A + 5E + 5E/zB7r2ryv2 + 3bW8yOs8L3A + CjxwPjxpbWcgc3JjPQ =
I. Code PreviewIn the past two days, emails are sent to struts2. The previous project was useful to spring. It was very convenient to use the mail support class provided by spring to complete this function. However, if we only use struts2, we
Directory structure: jsp imports jquery files, which always does not work because:Copy codeThe Code is as follows: It cannot access the files under the/WEB-INF/directory, so it is necessary to put the loaded js file into the webapp
There are several methods for jsp to obtain the session value from the action:For example, there is a session ("sessionid", "sessionValue") in my action ")1. Use the struts tag to obtain: Ii. session is also one of the built-in objects and can be
Let's not talk much about it. Let's look at the example above.InsertCopy codeThe Code is as follows:String SQL = "insert into allorder values ('" + orderid + "', '" + bookid + "', '" + amount + "', '"+ username + "')";Int result=stmt.exe cuteUpdate (
Jps commands are introduced in JDK1.5 to facilitate display of javaJVM process information. I used to use
ps -ef | grep java
Query the pid information of the java program, or check whether my appserver is running. Now, you can use jps to
Generally, the following two packages must be referenced to develop jsp custom tags:
ImportJavax. servlet. jsp .*;
ImportJavax. servlet. jsp. tagext .*;
First, we need to get a general idea of the interface and class hierarchy involved in the
First paste two flowcharts and then analyze them one by one:
Struts2 MVC Framework
Spring MVC Framework
Spring MVCPKStruts2
We use the traditional configuration file method when using struts2, and do not use the legendary 0 configuration. Spring3
After modifying the Servlet, You need to regenerate the class file, restart the server, and then open or refresh the web page to see the modification effect. The modification process is cumbersome and inconvenient. how to achieve what you see is
I. Brief Introduction to JSP 1. What is JSP? JSP stands for Java Server Pages. Like servle technology, JSP is a technology defined by SUN for developing dynamic web resources. The biggest feature of JSP technology is that writing jsp is like writing
When a url comes in, such as http: // localhost: 8080/pro/demo/hello. jsp? Name = john. On the hello. jsp page, we can get the name value as follows:Copy codeThe Code is as follows:String path = request. getContextPath ();String basePath = request.
Copy codeThe Code is as follows:Public interface JdbcTemplate extends JdbcOperations {Public abstract void beginTranstaion ();
Public abstract void commit ();
Public abstract void rollback ();}
Copy codeThe Code is as follows:Public class
Description1. Use the script language to allow JAVA to execute dynamic code2. You can use Spring to proxy scripting languages into Java interface implementation classes.3. Spring2.5.6 supports three scripting languages: ruby, Groovy, and BeanShell.4.
header name . The names of the headers that were last clicked on the page are compared with the names of the headers of this click, if the two are the same, they are arranged in the reverse order. Otherwise, the new columns are listed in ascending
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