You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Volker Krebs <vo...@abas.de> on 2009/09/01 11:53:37 UTC

Accessing http header with ognl

Hello,

accessing the http header with JSTL is quite easy:
${header}

but how can I do it using OGNL ?

<s:property value="%{request.header.referer}" />
<s:property value="%{header.referer}" />
Nothing is working.

The Problem is that request.getHeader() is never pushed onto the value 
stack. How can I enable it ?

thanks
Volker

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Accessing http header with ognl

Posted by Wes Wannemacher <we...@wantii.com>.
Try <s:property value="%{#request.header.referer}" />

http://struts.apache.org/2.x/docs/ognl.html

For non-root objects, you have to use the '#' symbol.

-Wes

On Tue, Sep 1, 2009 at 5:53 AM, Volker Krebs<vo...@abas.de> wrote:
> Hello,
>
> accessing the http header with JSTL is quite easy:
> ${header}
>
> but how can I do it using OGNL ?
>
> <s:property value="%{request.header.referer}" />
> <s:property value="%{header.referer}" />
> Nothing is working.
>
> The Problem is that request.getHeader() is never pushed onto the value
> stack. How can I enable it ?
>
> thanks
> Volker
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>



-- 
Wes Wannemacher

Head Engineer, WanTii, Inc.
Need Training? Struts, Spring, Maven, Tomcat...
Ask me for a quote!

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org