Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Wiki Markup
With expression like \[WW:0\] ... \[WW:3\] etc. WebWork will cut the stack and still returned back a CompoundRoot object. To get the top of that particular stack cut, use [0].top

ognl expression

description

<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="11dcc6fff9662cc2-c863ad66-49374611-81e7b40e-5922de4412ded6025c01ccfa"><ac:plain-text-body><![CDATA[

[WW:0].top

would get the top of the stack cut starting from element 0 in the stack (similar to top in this case)

]]></ac:plain-text-body></ac:structured-macro>

<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="5b4adb270db11b9d-5e5454eb-4a554a5f-9da9845c-f9d95f57220ad193d6aec2df"><ac:plain-text-body><![CDATA[

[WW:1].top

would get the top of the stack cut starting from element 1 in the stack]]></ac:plain-text-body></ac:structured-macro>

...

Wiki Markup
Besides the examples and descriptions given above, there are a few major changes in the EL since WebWork 1.x. The biggest one is that properties are no longer accessed with a forward slash \(/\) but with a dot (.). Also, rather than using ".." to traverse down the stack, we now use "\[WW:n\]" where n is some positive number. Lastly, in WebWork 1.x one could access special named objects (the request scope attributes to be exact) by using "@foo", but now special variables are accessed using "#foo". However, it is important to note that "#foo" does NOT access the request attributes. Because XWork is not built only for the web, there is no concept of "request attributes", and thus "#foo" is merely a request to another object in the OgnlContext other than the root.

Old Expression

New Expression

foo/blah

foo.blah

foo/someMethod()

foo.someMethod()

<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="12f3f307879ebc7e-2ed39b2d-4ecc4758-a4838d2c-03268dc9b7fd0811ed58e27b"><ac:plain-text-body><![CDATA[

../bar/blah

[WW:1].bar.blah

]]></ac:plain-text-body></ac:structured-macro>

@baz

not directly supported, but #baz is similar

<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="ec5af23f7fe0bb2b-a83dddf7-4fb14e9c-8155a028-798a65b35d9a538232d97ecd"><ac:plain-text-body><![CDATA[

.

top or [WW:0]

]]></ac:plain-text-body></ac:structured-macro>

...

name

value

<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="0b96ebdc795a4953-01481bff-4256468e-8a46b2b8-0e4d1606e286814fa5c4fcce"><ac:plain-text-body><![CDATA[

#parameters[WW:'foo'] or #parameters.foo

request parameter [WW:'foo'] (request.getParameter())

]]></ac:plain-text-body></ac:structured-macro>

<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="4d91271aa7db3634-fa53763f-42764eee-8f03a413-d6351be596eacf45b9521207"><ac:plain-text-body><![CDATA[

#request[WW:'foo'] or #request.foo

request attribute [WW:'foo'] (request.getAttribute())

]]></ac:plain-text-body></ac:structured-macro>

<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="2985c10d570bdebd-b418a3aa-44f84311-96dc9f26-3625dd8ba489a2466fbe54ff"><ac:plain-text-body><![CDATA[

#session[WW:'foo'] or #session.foo

session attribute 'foo'

]]></ac:plain-text-body></ac:structured-macro>

<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="3e8e275197ea2fa1-4478c11b-40fb4d97-ac1eb2c3-335fc477487b2f01d0a6f29e"><ac:plain-text-body><![CDATA[

#application[WW:'foo'] or #application.foo

ServletContext attributes 'foo'

]]></ac:plain-text-body></ac:structured-macro>

<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="fc3f9e5c00bfaa54-469ec819-431f42ad-b4f48003-256d4238be630c7a57ea2e44"><ac:plain-text-body><![CDATA[

#attr[WW:'foo'] or #attr.foo

Access to PageContext if available, otherwise searches request/session/application respectively

]]></ac:plain-text-body></ac:structured-macro>