comeOnGetIt comeOnGetIt - 2 years ago 65
HTML Question

& converted to & sometimes on request.getParameter("url") in jsp servlet

I have very simple input on HTML on JSP:

<input type="text" name="url" value="" />

User enters following value in above input:

On servlet side, when I do
I am getting following :;param2=b

How can I get original URL without

Answer Source

I finally found the solution. Just use org.apache.commons.lang.StringEscapeUtils.unescapeHtml(url) to escape any "&a m p;" (for that matter to escape any characters due to html encoding)

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download