struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fzli...@omnytex.com
Subject bean:write filter question
Date Wed, 22 Dec 2004 20:08:35 GMT
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

Mime
View raw message