The following code outputs a URL that is
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>
<ahref= "<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>
where <c:url value= "Http://localhost:8080/news/HelloServlet" var= "url" >
The value in is represented as a URL for the submitted Url,var
Name in/> of <c:param name= "Hello" value= "${hello}" is the names referenced below, such as ${hello},value as static values, that is, hello in ${hello}, but is converted to% Percent semicolon form, avoid URL submission Chinese characters appear garbled
This setting also needs to set the urlencoder= "Urf-8" in Tomcat/conf/server.xml, in addition to using the above method to eliminate garbled, you can also use the following methods: Pageactionsearch.action?resourcesname =<%=java.net.urlencoder.encode ("Mold", "UTF-8")%>
Black Hair: http://heisetoufa.iteye.com/