I do not believe you need to decode the string. The question is: did you encode the 
string? If you did not, then you do not need to decode it.

Try this instead:
<%-- The query comes in here, and we format it appropriately --%>
<c:set var="query"><%= request.getParameter("query")%></c:set>

Good luck.

Java Doug

-----Original Message-----
From: Nic Werner [mailto:[EMAIL PROTECTED]
Sent: Thursday, May 06, 2004 1:41 PM
To: Tag Libraries Users List
Subject: Url Decoding


I've setup two pages where I can basically type a query in, and the 
second page does the sql work. However, I'm trying to use the URLDecoder 
statement to format my query, and it throws an error whenever I have a 
query with the '%' sign:

URLDecoder: Illegal hex characters in escape (%) pattern - For input 
string: "')"

Is there a workaround  or JSTL equivalent for this? Here is the 
formatting code, I'm not too strong in this area, so any help would be 
appreciated.

- Nic.
----------------------
<%-- The query comes in here, and we format it appropriately --%>
<c:set var="query"><%= URLDecoder.decode(request.getParameter("query")) 
%></c:set>
<%-- Then we drop it into a sql query command, once again formatting --%>
<c:set var="newquery"><c:out value='${query}' escapeXml="false"/></c:set>

<c:catch var="error">
<sql:query var="search"><c:out value="${newquery}" 
escapeXml="false"/></sql:query>
</c:catch>
<c:out value="${query}"/>
<c:out value="${error}"/>
---------------------------------------




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to