For details about how to use the jsp image Verification Code under Struts, refer to another article html "> jsp image verification code. The principle is to generate a four-digit Verification Code randomly, write it into the Session, and generate an
1.1 write a servelet Program1.2 write a jsp program1.3 compile a Servlet Program1.4 Package A Servlets and Jsps Program1.5 build a deployment descriptor. 1.1 write a servelet Program ProblemYou want to write a servlet as a web
1. During js programming, a space is left before and after keywords and parentheses to improve program readability.
Function x () {...}. After JavaScript code is compressed, spaces are removed, mainly to improve readability.
2. When multiple
When writing Chinese characters in the JSP input box to the background, garbled characters often occur:
Today, I read a video from instructor Han shunping, got a preliminary understanding of the Garbled text, and wrote it out through my own
Today, I was hit by a JSP garbled problem. The solution is as follows:
1. The TOMCAT6.0.33 configuration file server. xml does not contain URIEncoding = "UTF-8"
The URL has a Chinese string and java is used in the background,
String str = request.
Parameters passing between JSP pages is a feature that is frequently used. Sometimes, parameters passing between multiple JSP pages are required. The following describes the implementation methods. (1) Add For example, directly passing parameters
JSP script ElementJsp declaration Syntax: The jsp declaration is only valid on the current page, and the jsp built-in object cannot be used in the jsp declaration. The variables or methods declared in it are instance methods or instance
The key to Chinese display is to identify at which stage the problem arises;
When obtaining data submitted by a jsp form:
Filter can be configured in web. xml (before struts filter must be configured)
encodingFilter org. springframework. web.
During the project process, we often encounter such a situation that we need to perform single-point logon, that is, users can log on to a system and other systems at the same time.
Here is an example to illustrate how to implement Single-point
Programming: using the HttpSessionListener listener interface to listen to the current number of online usersRequirements:(1) Compile a class to implement the HttpSessionListener interface. In the public void sessionCreated (HttpSessionEvent se)
Today, I wrote a logon page where I used the css of margin: 0 auto to center the div with the username and password. The result is normal in chrome and firefox, And the margin attribute in ie6 is invalid. After viewing the page and css, you cannot
In the network, changing the encoding from gb2312 to gbk does not take effect for a long time, including servelt, because it is garbled by default with the servlet itself in the database.
Later, we changed the page encoding to gbk on the jsp page,
Pages are often used in the network, and there are many paging implementations. The methods for returning paging data from the database are generally similar, mainly because of the differences on the webpage. Generally, we define an object class
Introduce CKEditor to the page:1. 2. Add class = "ckeditor" to the "content" textarea tag"
After the introduction, you can use CKEditor to edit the content of the text box, for example:
, TextArea has become a visual editing areaAfter editing the
There are many solutions to garbled code in JSP and struts2. Today I tried a new method, which is nice and super simple.
First, write a filter
[Java]Public class SetCodeFilter implements Filter { @ OverridePublic void destroy (){} @ OverridePublic
Servlet Filter)Introduction to FilterFilter is also called a Filter. It is the most exciting technology in Servlet technology. WEB developers use the Filter technology to manage all web resources on web servers, such as Jsp, Servlet, static image
When using the EL expression in JSP, You need to identify isELIgnored = "false". Otherwise, the EL expression is compiled as a normal string and the correct value is not displayed on the page. [Html] you can see this in 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.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service