Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3

...

OGNL's static access looks like this:

Code Block
languagejavatext
@some.package.ClassName@FOO_PROPERTY
@some.package.ClassName@someMethod()

...

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.foocurrent 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