Minor differences in JSP: Param processing in Tomcat 6.0.20

Source: Internet
Author: User

Too depressing. A new Tomcat 6.0.20 is installed, and a 404 exception is found in it.ProgramIt cannot always run.CodeI copied it from another code in use. The Code is as follows:


<JSP: Include page = "search. JSP "> <br/> <JSP: Param name =" keyword "value =" <% = new string (key. getbytes ("UTF-8"), "ISO-8859-1") %> "/> <br/> </jsp: Include>

Of course, the key in it can be used normally.

So whether this method cannot be used in value? Therefore, it is changed

String keyword = new string (key. getbytes ("UTF-8"), "ISO-8859-1"); <br/>%> <br/> <JSP: Include page = "search. JSP "> <JSP: Param name =" keyword "value =" <% = keyword %> "/> </jsp: Include> <br/> <%


Running properly, a bit strange. In previous versions, strings and expressions are not allowed in parameters, for example

Value = "myprefix <% = ID %>"


And use

Value = "<% =" myprefix "+ id %>

Yes. Is this version not allowed?

In short, when you use a changed parameter, it is always correct to use it after processing it out.

a little lesson, hehahaha!

Related Article

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.