Chinese garbled characters have plagued JSP
ProgramClerk, I often see this situation during programming;
After a piece of writing experience and absorbing his experience, the situation of "garbled characters in passing Chinese parameters through
1. Install JDK and eclipse in a Java environment
2. install Apache-Tomcat-6.0.26
3 install mysql-5.0.22-win32 and a graphical interface mysql-gui-tools-5.0-r17-win32
3 install myeclipse-8.0.0-win32
You can also set myclipse, add the JDK path,
Declare valid variables and methods in JSP programs
JSP syntax
Example
Description
Declare the variables and methods you will use in the JSP program. You must do the same. Otherwise, an error will occur.
You can declare multiple variables
When talking about JSP program design, we should first understand the HTTP protocol.
1. Basic HTTP knowledgeHTTP is a hypertext transfer protocol and stateless protocol. It uses the default open port 80. The Browser needs to establish a connection
Garbled characters may occur when parameters are passed in the URL on the JSP page.
The solution is as follows:
1. Use the method to change tomcat. This method is simple, but it must be modified at the server software level. If the system is
(1) Introduction to built-in objects
JSP provides some internal objects to simplify page development. These internal objects do not need to be instantiated by JSP writers. They are implemented and managed by containers on all JSP pages.
Internal
255) FF = 255; If (CC> 255) cc = 255; int r = FF + random. nextint (CC-ff); int G = FF + random. nextint (CC-ff); int B = FF + random. nextint (CC-ff); return new color (R, G, B) ;}%>
This example is a good example. This article mainly describes how to pass a value to the JSP page in servlet. In this example, the value is divided into three parts, 1. pass in a common string 2. pass in a common list 3. pass in a list with multiple
Common jsp q &
1. How to mix JSP and SSI # include?In JSP, you can use the following method to include pure HTML:However, if data. inc contains JSP code, we can use:
2. How to execute a thread-safe JSP?Add the following command:
3. How does JSP
String agent = request. getheader ("User-Agent ");Stringtokenizer ST = new stringtokenizer (agent ,";");St. nexttoken ();// Obtain the user's browser nameString userbrowser = ST. nexttoken ();// Obtain the user's OS nameString useros = ST. nexttoken
This time, we use flex for remote and JSP access, and return XML data values. The following is an encapsulated class that inherits the httpservice class.
Package config { Import flash. events. *; Import flash.net. *; Import MX. RPC. events.
Since Javascript is not required to strictly control the running of the applet, the code is much simpler than previously:
// Appletaccess. js
// @ Author zenny Chen
Function accessapplet ()
...{
If(window.doc ument. testapplet! = NULL )...{
VaR IP =
1.: http://opensource.adobe.com/wiki/display/flexsdk/downloadsOr download the flex compiler modules: flexmodule_j2ee.zip.
2: extract webtier. War to replace the WEB-INF, META-INF under the original project3: If the server is on, restart. 4: you
Cookie concept:The cookie format is actually a piece of plain text information, which is sent by the server along with the webpage to the client and saved in the specified directory on the client's hard disk. it is said that cookies may cause
Recently, I 've been idle about building a development framework. I 've encountered many problems. Google is often disconnected from the Internet, so I have no choice but to build a VPN. I still like to use Google to search for technical issues.
I
1. Insert the following code in server. xml under Tomcat:
Connectiontimeout = "20000"Redirectport = "8443" type = "regxph" text = "yourobjectname"/>
2. Encrypt parameters to be passed in JSP page JS
Encodeuri (PARAM)
2. Write in action
Request.
. The presentation layer of JSP/jsp bean should be as thin and simplified as possible.. Remember that most JSP pages should be read-only views, and the page bean provides the model.. JSP and JSP bean should be designed together. Remove the business
When running the JSP program, you need to download and open the Word, Excel, and PowerPoint files on the page. The solution is garbled:
Find the tomcat installation directory and find the conf \ WEB. xml file.
To add the mime-mapping parameter
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