/**
         * Renders an arbitrary string to the header. The string is only
rendered if the same string
         * hasn't been rendered before.
         * <p>
         * Note: This method is kind of dangerous as users are able to write
to the output whatever they
         * like.
         *
         * @param string
         *            string to be rendered to head
         */
        public void renderString(CharSequence string);

-igor

On Tue, Jul 27, 2010 at 8:48 AM, Martin Makundi
<[email protected]> wrote:
> Hi!
>
> Is it abug or a feature that if I have the following:
>
>  public void renderHead(IHeaderResponse response) {
>      // Tweak 1
>      response.renderString(CssUtils.INLINE_OPEN_TAG);
>      response.renderString("div.upper-background-canvas { background:
> url(/images/template-bg.png) repeat-x rgb(55,115,130); } body {
> background: none rgb(68,68,20); } ");
>      response.renderString(CssUtils.INLINE_CLOSE_TAG);
>      // Tweak 2
>      response.renderString(CssUtils.INLINE_OPEN_TAG);
>      response.renderString("div.container-panel { width: 98%; }");
>      response.renderString(CssUtils.INLINE_CLOSE_TAG);
>  }
>
> The result rendered in browser is:
> <style type="text/css"><!--
> div.upper-background-canvas { background: url(/images/template-bg.png)
> repeat-x rgb(55,115,130); } body { background: none rgb(68,68,20); }
> --></style>
> div.container-panel { width: 98%; }
>
> This seems sensless... it considers the css script open/close tags
> duplicate and drops them from the rendering phase. I will do the same
> for any javascript line? For example if I had "alert(value);" in
> multiple places it would just strip them and I would get bizzearre
> results?
>
> Seems a bit over-optimized to me .... what do you think?
>
>
> **
> Martin
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to