struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fzli...@omnytex.com
Subject Re: bean:write filter question
Date Wed, 22 Dec 2004 20:17:04 GMT
That's indeed what I suspected, but I was hoping...

-- 
Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
http://www.omnytex.com

On Wed, December 22, 2004 3:14 pm, Jeff Beal said:
> The filtering in <bean:write/> probably only escapes characters that
> have significance in HTML, not JavaScript.  Since 'A:\' doesn't need to
> be escaped in raw HTML content, it doesn't do anything with it.
> 
> fzlists@omnytex.com wrote:
>> Hello all... I have a situation where I have to insert a path into a
>> Javascript call, like so:
>>
>> <table>
>>   <logic:iterate id="listItem" name="sidebarFolderViewActionForm"
>> property="itemsList" type="java.io.File">
>>   <tr>
>>     <td>
>>       <a onClick="openFolder("<bean:write name="listItem"
>> property="path" />");">
>>         <bean:write name="listItem" property="path" />
>>       </a>
>>       <br>
>>     </td>
>>   </tr>
>> </logic:iterate>
>> </table>
>>
>> Problem is, on Windows anyway, the path includes a backslash, so when
>> rendered you get for example:
>>
>> <table>
>>   <tr>
>>     <td>
>>       <a onClick="openFolder("A:\");">
>>         A:\
>>       </a>
>>       <br>
>>     </td>
>>   </tr>
>> </table>
>>
>> ...which of course is a script error because the backslash is escaping
>> the quotation mark.
>>
>> So, how does one deal with this?  As I understant, filter="true" is the
>> default setting for bean:write... I tried setting it explicitly, to no
>> avail.
>>
>> Thanks!
>>
>> Frank W. Zammetti
>> Chief Software Architect
>> Omnytex Technologies
>> http://www.omnytex.com
>>
>>
>> ------------------------------------------------------------------------
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
> 


Mime
View raw message