Struts DispatchAction and LookupDispatchAction

I

Ian

I have been trying to get both the DispatchAction and
LookupDispatchActions working (...by extending those classes, not
using them directly).

Unfortunately, they only seem to work when the execute method does not
exist. If the execute method does exist, it will always default to
that method - and never use my 'custom' methods.

The reason I ask this is because I really don't like the thought of
using only eg: search.do?action=simple and search.do?action=advanced.

I would prefer to use search.do (which defaults to simple using the
standard execute method) along with both of the above examples.

Is this the expected behavour? Am I doing something wrong?
 
T

Theo

Override the unspecified() method in your DispatchAction class.
Unspecified() is the default ActionForward when no dispatch parameter
is specified in the request.
 
W

Wendy S

Theo said:
Override the unspecified() method in your DispatchAction class.
Unspecified() is the default ActionForward when no dispatch parameter
is specified in the request.

Are you sure? The source code may have changed, but unspecified() in LDA
used to only work if the dispatch parameter was present but did not match
any of the choices in getKeyMethodMap().

I seem to recall discussion on struts-dev about fixing that, so hopefully
it's been done by now. If not, override execute() and make sure the param
is present, then call super.execute() and let LDA dispatch appropriately.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,011
Latest member
AjaUqq1950

Latest Threads

Top