Data AccessCore JavaApp FrameworksViewTestingBuildingDeploymentDev ToolsSecurityOpinions

Tuesday, September 8, 2009

Accessing HTTP Header with OGNL

OGNL stands for Object-Graph Navigation Language; it is an expression language for getting and setting properties of Java objects. You use the same expression for both getting and setting the value of a property.

Struts2 adds on top of OGNL by providing support for a 'Value Stack'. While OGNL operates under the assumption there is only one "root", XWork's ValueStack concept requires there be many "roots". Have a quick read on OGNL basics.

When referring to non-root objects are accessed with a (#) sign.

Accessing an HTTP Header can be achieved by the following code.
<s:property value="#header.myHeaderPropKey"/> or
<s:property value="#header['myHeaderPropKey']"/> or


  1. I have read your blog its very attractive and impressive. I like it your blog.

    Java Training in Chennai Java Training in Chennai | Core Java Training in Chennai

    Online Java Training Java Online Training | Java J2EE Online Training | JavaEE Training Institute in Chennai

  2. Since the exchange engaged with a business loan is the buy of future charge card receivables, they are paid back as you process Visas. Cash Advances San diego

  3. Cache is one of the essential thing you should know about the internet and your computer, find out more on how to clear cache