...
Old Expression | New Expression |
---|---|
foo/blah | foo.blah |
foo/someMethod() | foo.someMethod() |
../bar/blah | [1].bar.blah |
@baz | not directly supported, but #baz is similar |
. | 'top' or [0] |
Struts 2 Named Objects
Struts 2 places request parameters and request, session, and application attributes on the OGNL stack. They may be accessed as shown below.
name | value |
---|---|
#action['foo'] or #action.foo | current action getter (getFoo()) |
#parameters['foo'] or #parameters.foo | request parameter ['foo'] (request.getParameter()) |
#request['foo'] or #request.foo | request attribute ['foo'] (request.getAttribute()) |
#session['foo'] or #session.foo | session attribute 'foo' |
#application['foo'] or #application.foo | ServletContext attributes 'foo' |
#attr['foo'] or #attr.foo | Access to PageContext if available, otherwise searches request/session/application respectively |