> From: Gemes Tibor [mailto:[EMAIL PROTECTED]
> addName('<bean:write name="person" property="lastname" 
> filter="true"/>');
> This filters the html sensitive chars. 

Nope, that doesn't do the job (filter is true by default, btw).

It creates output like this:

addName('O&#39;Reilly');

which causes javascript errors.
Instead, it should be:

addName('O\'Reilly');

Since I already had my own taglib which wrapped bean:write, I just added
another attribute called javascriptEscape to be set to either true or false.

It does:
  ' to \'
  " to &quot;
  \n(newline) to \n (\\n)
  \r(newline) to \r (\\r)

Matt

Reply via email to