<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'....

Reply via email to