A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Win a copy of
video training course this week in the
Joined: Oct 23, 2003
Dec 14, 2005 15:03:00
I am new to
and I have come accross a problem.
I have one action class which extends DispatchAction and it used to display list of Emps or Depts depending on actionType parameter.
Now I have one more class DispatchAction Class which I use to either edit or add new Emp depending on value of actionType parameter.
After adding an employee, I want to forward it to ShowList action.
<!-- Default forward to "Welcome" action -->
<!-- Demonstrates using index.jsp to forward -->
<forward name="welcome" path="/Welcome.do"/>
<forward name="ShowList" path="/ShowList.do"/>
<forward name="ShowEmpList" path="/pages/EmpList.jsp"/>
<forward name="ShowDeptList" path="/pages/DeptList.jsp"/>
<forward name="success" path="/ShowList"/>
Obviously this will not work because after adding emp, actionType parameter will have value either addEmp or editEmp and showList action expects showEmpList or showDeptList.
Is there a way to set parameter actionType to some value(e.g. showEmpList in this case) in Action class,before I forward action to ShowList
Joined: Feb 15, 2005
Dec 14, 2005 19:14:00
Try this in your action:
forward = mapping.findForward("ShowList");
Did you see how Paul
cut 87% off of his electric heat bill with 82 watts of micro heaters
subject: Newbie Question
Dispatch Action Issue/Exception
Error 400: Invalid path /main was requested
Cannot find bean in any scope
Problem with Struts validator
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2015