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="9c265c6d4ff4b514-4ea7b4e7-48944ccb-b740859d-f2818e04776814af34c59943"><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="bfba48482747f29e-291a5c69-435944e1-99d6a658-7e3af080f262e4b9f064e0df"><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="878c4d50980e1351-b4104fe9-4abd47d3-bf9ca7a3-742165845d15ff14c90aeed5"><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="420360c566c2ad30-48da5cfb-47cf4176-83bb9128-15d3da1dc5da5b51cffc296a"><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="af3c1246d3ad8583-93b8fa00-4ca6438c-990f9aca-f3add14123b8098426b0def3"><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="d9eb59da2cbe8bb2-9cbcc953-45b643ca-80e29ed9-43e64befadf4bd6cce8ce770"><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="7274842816aa9fad-115bb1b4-4eaf4590-be759895-f0449914eb6fc2458917fa3f"><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="80ac81c4d83c3118-d9fb6cd2-47aa4eb2-840db4e5-b1249473c6d00344377dd330"><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="c1348b967838578c-7746f28f-45d241ca-81b98e77-00c0abd969860f8e716ea736"><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>