To better protect your JSP against unauthorized access and peeping, a good way is to store the page file under the WEB-INF directory of the Web application.
Generally, JSP developers store their page files in the corresponding subdirectories of the
1. parameter transmission garbled characters
1. Parameter garbled characters passed in post mode:
Add a filter or request. setcharacterencoding ("UTF-8 ");
2. parameters transmitted in URI or get are garbled:
Modify tomcat/config/server. xml
User Requirements: There is an Excel table. Now you want to import the data in the Excel table to the system and display it on different JSP pages. Then, the owners of different pages review whether the content on the page is qualified. After
I am bored with my recent internship. I started to learn J2EE and started to learn from Servlet/JSP. Here I am writing my own learning remarks.
Java Web application development is very simple. Generally, the architecture is: Small Web applications
To reference the path of the current folder, I searched for a lot of information about the JSP path on the Internet and listed it one by one for reference:
The absolute path of the Directory, to the root directory folder of the Directory, such as
JSP has nine built-in objects: request, response, session, application, out, pagecontext, config, page, and exception. These objects are implemented and managed by system containers and can be directly used on the JSP page without being defined.I.
JSP: Java Server PagesRun on the server page developed in Java
HTML + JavaScript --- the page running on the client
Client ---- HTML ----> servlet ---> Dao ---> DB
Advantages and disadvantages of servlet:Process business logicDisplay page out.
When testing the JSP program today, I want to see what the Java code translated by the server into JSP looks like. So I searched in the glassfish directory and found the translated Java code as follows:
Package org. Apache. jsp;
Import javax.
Use JSP to print Word and Excel reports (2)[Date:] Source: http://www.gs008.com/blog/blogview.asp? Logid = 325
Because documents in MS Word and Excel support HTML text format, you can use Word or Excel to make a template, save it as a Web page,
JSP provides some built-in objects to simplify page development. These built-in objects do not need to be instantiated and are implemented and managed by containers.
1. Out object: It mainly outputs data to the client
2. Request object: requests
Testoutofmemory
Save the above Code to JSP and publish it to Tomcat, resin, WebLogic, and websphere. What are the results of experiment access to JSP?
The answer is:
All servers except resin will shut down. Why doesn't resin?
In fact,
This problem has plagued me for a long time. The previous method was to use JS, And now I finally found a solution:
Popular online versions:
response.setHeader("Pragma", "No-cache");
response.setHeader("Cache-Control", "no-cache");
When Using JSP in multiple languages (Chinese, Japanese, and English supported), I use editplus
Replace
Then an error is reported during running:
Java. Io. charconversionexception: Illegal utf8 Encoding
At first I thought the UTF-8 was
Step 1:
Modify in Web. xml:
struts2 /* request forward
Step 2:
Modify or add in Web. xml
index. JSP
Step 3:
First jump statement:
The content in index. jsp is as follows:
To automatically refresh the JSP page for a period of time, use the following method:
Use the Meta Refresh tag for Refresh.Meta Tags are part of the section of the HTML document.Example:
After a period of time, the system automatically
The request object has completed the httpservletrequest interface, deciding that it can obtain Users' Request Parameters, obtain cookies, obtain HTTP request headers, and obtain users' IP addresses. The first essentials of the request object
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