Re: HTML-safety best practices

2012-06-15 Thread Thomas Broyer
On Friday, June 15, 2012 5:28:54 AM UTC+2, tong123123 wrote: I found in gwt 2.4, the ImageCell Class is interface Template extends SafeHtmlTemplates{ @Template (img src=\{0}\/ SafeHtml img(String url); } so it will rise the warning Template with variable in URL attribute

Re: HTML-safety best practices

2012-06-14 Thread tong123123
I found in gwt 2.4, the ImageCell Class is interface Template extends SafeHtmlTemplates{ @Template (img src=\{0}\/ SafeHtml img(String url); } so it will rise the warning Template with variable in URL attribute context:The template code generator cannot guarantee HTML-safety of the

Re: HTML-safety best practices

2012-03-23 Thread dhoffer
Okay that makes sense, thanks for the help! -Dave On Mar 21, 9:48 am, Thomas Broyer t.bro...@gmail.com wrote: On Wednesday, March 21, 2012 4:15:10 PM UTC+1, dhoffer wrote: I have a few questions about this. If I change to: interface Template extends SafeHtmlTemplates {        

Re: HTML-safety best practices

2012-03-21 Thread dhoffer
I have a few questions about this. If I change to: interface Template extends SafeHtmlTemplates { @Template(img src=\{0}\/) SafeHtml img(SafeUri safeUri); } 1. How does the template know to call asString() on the safeUri instance? 2. With this change I now have the same problem

Re: HTML-safety best practices

2012-03-21 Thread Thomas Broyer
On Wednesday, March 21, 2012 4:15:10 PM UTC+1, dhoffer wrote: I have a few questions about this. If I change to: interface Template extends SafeHtmlTemplates { @Template(img src=\{0}\/) SafeHtml img(SafeUri safeUri); } 1. How does the template know to call

HTML-safety best practices

2012-03-20 Thread David Hoffer
I get the following error: [INFO] Generating method body for img() [INFO] [WARN] Template with variable in URL attribute context: The template code generator cannot guarantee HTML-safety of the template -- please inspect manually or use SafeUri to specify arguments in a URL attribute context

Re: HTML-safety best practices

2012-03-20 Thread Jens
You should use GWT's UriUtils to construct a SafeUri and your template method should then take a SafeUri as parameter instead of a string. -- J. Am Dienstag, 20. März 2012 20:22:59 UTC+1 schrieb dhoffer: I get the following error: [INFO] Generating method body for img() [INFO] [WARN]