Versions Compared

Key

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

...

If the request URL is /users/10/detail, then the DetailsAction will be executed and its userID field will be set to 10.

Only

one

PatternMatcher

implementation

can

be

used

at

a

time.

The

two

implementations

included

with

Struts

2

are

mutually

exclusive.

You

cannot

use

Wildcards

and

Named

Variable

patterns

at

the

same

application

(if

that

were

required,

you'd

need

to

create

a

custom

PatternMatcher

implementation).

Some

tags

tags

not

are

100%

compatible

with

variables

in

the

namespace.

For

instance,

they

may

write

the

literal

namespace

into

the

HTML

(eg

/{user}/2w)

instead

of

the

path

used

in

the

request

(ie.

/brett/24).

This

usually

affects

attributes

that

attempt

to

guess

the

namespace

of

an

action

(eg.

Form

tag,

Action

tag,

action=).

This

problem

can

be

avoided

by

using

HTML

tags

directly

with

relative

paths

or

explicit

URLs.

Warning
Wiki Markup
Note

Similar functionality can also be implemented using a custom ActionMapper. The ActionMapper will need to parse the namespace and request itself to set parameters on the matched action. The default ActonMapper is responsible for invoking the PatternMatcher.

...