You are viewing a plain text version of this content. The canonical link for it is here.
Posted to taglibs-dev@jakarta.apache.org by Rick Bullotta <ri...@lighthammer.com> on 2004/04/06 20:53:05 UTC
Encoded string values in URL for import tag
The following tag usage fails if the request parameter "TheParam" has HTML
encoded values in it:
<c:import var="docString"
url="http://localhost/servlet/MyServlet?MyParam=${param.TheParam}"/>
If the JSP page is called with something such as:
http://MyWebApp/MyPage.jsp?TheParam=This%20Or%20That
or
http://MyWebApp/MyPage.jsp?TheParam=This+Or+That
...an exception is thrown.
Any insights? Any way to embed encoded values in the url attribute in a
dynamic manner?
Thanks!
- Rick
RE: Encoded string values in URL for import tag
Posted by Rick Bullotta <ri...@lighthammer.com>.
Thanks, Martin. Works like a charm. I was surprised that the "inlined"
approach didn't work (I suspected that the + and % characters were being
treated as arithmetic operators by the EL processor), and started to make my
way through the source code, but you saved me the effort. When I have time,
I'll try to sleuth out why the two behaviors are different.
- Rick
-----Original Message-----
From: news [mailto:news@sea.gmane.org] On Behalf Of Martin Cooper
Sent: Tuesday, April 06, 2004 3:14 PM
To: taglibs-dev@jakarta.apache.org
Subject: Re: Encoded string values in URL for import tag
Try this instead:
<c:import var="docString" url="http://localhost/servlet/MyServlet">
<c:param name="MyParam" value="${param.TheParam}"/>
</c:import>
--
Martin Cooper
"Rick Bullotta" <ri...@lighthammer.com> wrote in message
news:200404061853.OAA02852@tonnant.nxlkhost.com...
> The following tag usage fails if the request parameter "TheParam" has HTML
> encoded values in it:
>
>
>
> <c:import var="docString"
> url="http://localhost/servlet/MyServlet?MyParam=${param.TheParam}"/>
>
>
>
> If the JSP page is called with something such as:
>
>
>
> http://MyWebApp/MyPage.jsp?TheParam=This%20Or%20That
>
>
>
> or
>
>
>
> http://MyWebApp/MyPage.jsp?TheParam=This+Or+That
>
>
>
> ...an exception is thrown.
>
>
>
> Any insights? Any way to embed encoded values in the url attribute in a
> dynamic manner?
>
>
>
> Thanks!
>
>
>
> - Rick
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: taglibs-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: taglibs-dev-help@jakarta.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: taglibs-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: taglibs-dev-help@jakarta.apache.org
Re: Encoded string values in URL for import tag
Posted by Martin Cooper <ma...@apache.org>.
Try this instead:
<c:import var="docString" url="http://localhost/servlet/MyServlet">
<c:param name="MyParam" value="${param.TheParam}"/>
</c:import>
--
Martin Cooper
"Rick Bullotta" <ri...@lighthammer.com> wrote in message
news:200404061853.OAA02852@tonnant.nxlkhost.com...
> The following tag usage fails if the request parameter "TheParam" has HTML
> encoded values in it:
>
>
>
> <c:import var="docString"
> url="http://localhost/servlet/MyServlet?MyParam=${param.TheParam}"/>
>
>
>
> If the JSP page is called with something such as:
>
>
>
> http://MyWebApp/MyPage.jsp?TheParam=This%20Or%20That
>
>
>
> or
>
>
>
> http://MyWebApp/MyPage.jsp?TheParam=This+Or+That
>
>
>
> ...an exception is thrown.
>
>
>
> Any insights? Any way to embed encoded values in the url attribute in a
> dynamic manner?
>
>
>
> Thanks!
>
>
>
> - Rick
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: taglibs-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: taglibs-dev-help@jakarta.apache.org