tomcat-taglibs-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Hassan Schroeder <has...@webtuitive.com>
Subject Re: encode tag
Date Mon, 21 Feb 2005 17:07:25 GMT
Eduardo Yáñez Parareda wrote:
> Hello, I don't get escape tag works fine. 

> <tr><td>'<str:escape>Test"tseT</str:escape>'</td></tr>

> <tr><td>"<str:escape>Test'tseT</str:escape>"</td></tr>
> 
> And this is what I get:
> 
> 'Test\"tseT'
> "Test'tseT"
> 
> So I don't get single quotes being escaped. Is there any bug with this tag?

Looks like :-)

A quick look at the source shows it's based on the commons-lang code
but that seems fine -- the following:

<jsp:directive.page import="org.apache.commons.lang.StringEscapeUtils"/>
<jsp:scriptlet>
	String foo = "Test\"tseT";
	String bar = "Test'tseT";
	out.println(StringEscapeUtils.escapeJavaScript(foo));
	out.println(StringEscapeUtils.escapeJavaScript(bar));
</jsp:scriptlet>

:: produces, as expected:

Test\"tseT
Test\'tseT

Not sure where the problem is, and no more time to look right now;
maybe later. Or you could file a bug report :-)

-- 
Hassan Schroeder ----------------------------- hassan@webtuitive.com
Webtuitive Design ===  (+1) 408-938-0567   === http://webtuitive.com

                           dream.  code.



---------------------------------------------------------------------
To unsubscribe, e-mail: taglibs-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: taglibs-user-help@jakarta.apache.org


Mime
View raw message