tomcat-taglibs-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rahul P Akolkar <akol...@us.ibm.com>
Subject Re: Mixing JSTL with scriptlet and problematic evaluation order
Date Tue, 14 Dec 2004 00:14:30 GMT
<c:url var="encodedUrl" 
value="Blah.do?sortId=${sortId}&...&title=${titleText}&..."/>

onclick="javascript:window.open('${encodedUrl}', ...)"



> Because I couldn't find a nice JSTL solution, I tried it with a mixture
> of JSTL and the scriptlet:
> 
> ...&title=' + '<%= URLEncoder.encode("<c:out value='${titleText}'/>",
> "UTF-8") %>'
>
> Guess what this results in?
> Well, the scriptlet part must be getting interpreted first, so the
> URLEncoder.encode gets that "<c:out value..." string literal as input,
> instead of getting the output of c:out.  So that doesn't work either.
> 
> Here is a bit more of the JavaScript call in question:
> 
> onclick="javascript:window.open('Blah.do?sortId=<c:out
> value="${sortId}"/>&......&title=' + '<%= URLEncoder.encode("<c:out
> value='${titleText}'/>", "UTF-8") %>', 'Foobar'....
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message