The following code outputs the URL
Http: // localhost: 8080/news/helloservlet? Hello = % E5 % A4 % A7 % E5 % AE % B6 % E5 % a5 % BD & test = % E5 % A4 % A7 % E5 % AE % B6 % E5 % a5 % BD
HTML code
- <Body>
- <C: URLValue = "http: // localhost: 8080/news/helloservlet" Var = "url">
- <C: ParamName = "hello" value = "$ {Hello }"/>
- <C: ParamName = "test" value = "$ {Hello }"/>
- </C: URL>
- <Href = "<C: Out
Value = "$ {URL }"/>">$ {Hello}</A>
- </Body>
<Body> <C: URL value = "http: // localhost: 8080/news/helloservlet" Var = "url"> <C: param name = "hello" value = "$ {Hello}"/> <C: Param name = "test" value = "$ {Hello}"/> </C: URL> <a href = "<C: Out value =" $ {URL} "/>" >$ {Hello} </a> </body>
<C: URL value = "http: // localhost: 8080/news/helloservlet" Var = "url">
The value in is the submitted URL, and VaR is the URL
<C: Param name = "hello" value = "$ {Hello}"/> indicates the name referenced below. For example, $ {Hello} indicates a static value, that is, the hello in $ {Hello} is displayed, but will be converted to % Percent form to avoid garbled characters when the URL is submitted.
This setting also requires setting urlencoder = "urf-8" in Tomcat/CONF/server. xml"
In addition to the above method, you can also use the following method: pageactionsearch. Action? Resourcesname = <% = java.net. urlencoder. encode ("Mold", "UTF-8") %>
Black hair: http://heisetoufa.iteye.com/