Hi all,
I'm trying to do a form wizard w/o having to download anymore thirdparty plugins like struts-flow or livinglogic.de so i found the example on apache's newbie faq.
I also created an Action class that extended the LookupDispatchAction.
I followed the instructions on the LookupDispatchAction javadoc by creating the form-bean entry in my struts-config.xml and made the following jsp changes. In my Action class that extends the LookupDispatchAction, I added the two methods per the instructions:
public ActionForward add(ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response)
throws IOException, ServletException {
// do add
return mapping.findForward("success");
}
public ActionForward delete(ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response)
throws IOException, ServletException {
// do delete
return mapping.findForward("success");
}
However it seems that those two, methods are never called. Only the
public ActionForward execute(...)
method is invoked when I click on any of the buttons. What am I missing here?
tia,
Patrick
-
Struts form wizard + LookupDispatchAction (7 messages)
- Posted by: Patrick Lacson
- Posted on: December 02 2004 14:31 EST
Threaded Messages (7)
- Struts form wizard + LookupDispatchAction by Patrick Lacson on December 02 2004 14:34 EST
- Rsources by Joe Fouad on December 03 2004 12:13 EST
-
Rsources by Patrick Lacson on December 03 2004 06:13 EST
-
Rsources by Patrick Lacson on December 03 2004 08:32 EST
- Thanks by Tom Ziemer on February 16 2005 04:31 EST
-
page not found by ramesh ponnada on March 02 2005 12:17 EST
- page not found by Patrick Lacson on May 12 2005 05:45 EDT
-
Rsources by Patrick Lacson on December 03 2004 08:32 EST
-
Rsources by Patrick Lacson on December 03 2004 06:13 EST
- Rsources by Joe Fouad on December 03 2004 12:13 EST
-
Struts form wizard + LookupDispatchAction[ Go to top ]
- Posted by: Patrick Lacson
- Posted on: December 02 2004 14:34 EST
- in response to Patrick Lacson
In case you're wondering, I did also include that getMapKeyMethod(...)
protected Map getKeyMethodMap() {
Map map = new HashMap();
map.put("button.add", "add");
map.put("button.delete", "delete");
return map;
}
--patrick -
Rsources[ Go to top ]
- Posted by: Joe Fouad
- Posted on: December 03 2004 12:13 EST
- in response to Patrick Lacson
did u correctly defined button.add and button.delete in ur resource bundle
and did u use that correctly from jsp -
Rsources[ Go to top ]
- Posted by: Patrick Lacson
- Posted on: December 03 2004 18:13 EST
- in response to Joe Fouad
Yes, my resources are working fine.
The lookupDispatchAction javadoc mentions defining that getKeyMapMethod and adding your methods for the key values of your buttons, but when are those new methods ever invoked?
I looked at the source code of LookupDispatchAction and it only invokes the getKeyMapMethod when you do a lookupMethoName call.
Am I suppose to add logic in my execute method that determines the methodName (add,delete,...) and then call the added add(...), delete (...) methods? I thought it was suppose to happen automagically?
What am I missing here?
thanks,
Patrick -
Rsources[ Go to top ]
- Posted by: Patrick Lacson
- Posted on: December 03 2004 20:32 EST
- in response to Patrick Lacson
What I really hate are discussion groups that identify my problem exactly, yet the solution was never solved!!
In case you sympathize with my dilemma, I think i solved this problem. The execute method is not to be overwridden in your LookupDispatchAction subclass -- you just depend on the getMapKeyMethod to address that. My problem was that my action tags were not properly defined.
If anybody's interested in a concrete example of the LookupDispatchAction class for a wizard like multipage form, here's the code -
Thanks[ Go to top ]
- Posted by: Tom Ziemer
- Posted on: February 16 2005 04:31 EST
- in response to Patrick Lacson
Thanks for posting your solution. Most of the time people dont't do this once their problem is solved! -
page not found[ Go to top ]
- Posted by: ramesh ponnada
- Posted on: March 02 2005 00:17 EST
- in response to Patrick Lacson
Hi patrick
I couldnot goto the Code page as it is showing some error message. can you please guide me how to get there.
bye
Thanks
Ramesh -
page not found[ Go to top ]
- Posted by: Patrick Lacson
- Posted on: May 12 2005 17:45 EDT
- in response to ramesh ponnada
Sorry, I recently upgrade my website. Check again, that link should redirect you to the proper page. If not here it is:
http://lacson.name/archives/2004/12/struts_lookupdi.html
thanks,
patrick