How to change the single quotation mark in double quotation marks when Tomcat is upgraded to 6.0

Source: Internet
Author: User
An error occurred during the following call: <JSP: Include page = "fastpost. JSP "> <JSP: Param name =" returl "value =" <% = URL. encode (***) %> "/> </jsp: Include> here, the URL is used in the value. Then, an error is reported: attribute value URL. encode (***) is quoted with "which must be escaped when used within the value. If you are speechless, is that true on another page? Google. I found the bug after Apache was upgraded to 6.0. For more information, see [# MMB-1706] quoted must be escaped-mmbase and then trace the link, which is detailed here: possible user code changes required when we upgrade to Tomcat 6.0.18 according to the above statement, so rewrite: <JSP: Include page = "fastpost. JSP "> <JSP: Param name =" returl "value = '<% = URL. encode (***) %> '/> </jsp: Include> actually, you only change value = "" to value = ''.

For the above problem, I tested it with the tomcat5.5 installation version and the tomcat6.0.2 decompression version respectively. It is true that the single quotation marks will be used after the prompt value under tomcat6.0.2 ..

I think it is unacceptable to change double quotes to single quotes. Because our program has been written, are all changed to single quotes?

Check Google again. It is said that there is no error in using the decompressed version of tomcat6.0, but this problem occurs in the installed version .. However, in my tests, the decompressed version of tomcat6.0 is also problematic... So let's look at it again.

You can change the default tomcat behavior by setting System Properties: org. apache. jasper. compiler. parser. STRICT_QUOTE_ESCAPING If false the requirements for escpaing quotes in JSP attributes will be relaxed so that a missing required quote will not cause an error. if not specified, the specification
Compliant default of true will be used.

Open Web: http://tomcat.apache.org/tomcat-5.5-doc/config/systemprops.html

We can see that we can modify this configuration to solve this problem.

The final solution to this problem is:

Modify the catalina. properties file under Tomcat Directory: D: \ Java \ tomcat-6.0.20 \ conf and add it to the end:

Org. apache. jasper. compiler. Parser. STRICT_QUOTE_ESCAPING = false

You can. From: http://quicker.iteye.com/blog/739779

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.