| Author |
Cancell function in Struts(Action class)
|
Seetharaman Venkatasamy
Ranch Hand
Joined: Jan 28, 2008
Posts: 5575
|
|
hi All, i have addemployee form(jsp) in struts... when i click the cancel button i get exception: Servlet.service() for servlet action threw exception org.apache.struts.action.InvalidCancelException below the Action class ---------------------------------------- public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) { // TODO Auto-generated method stub String target=new String("success"); if(isCancelled(request)){ return mapping.findForward("success"); } try{ form=buildEmployeeForm(request.getParameter("employeeid"), request); if("request".equals(mapping.getScope())){ request.setAttribute(mapping.getAttribute(),form); }else{ HttpSession session=request.getSession(); session.setAttribute(mapping.getAttribute(),form); } }catch(Exception ex){System.out.println("ex in GetEmployeAction");} return mapping.findForward(target); } } ---------------------------------- please any one can explain me.. thanks & regards, seetharaman
|
 |
Merrill Higginson
Ranch Hand
Joined: Feb 15, 2005
Posts: 4864
|
|
Starting with Struts version 1.2.9, in order to use the cancel button in an action, you must declare it in the action mapping in the struts-config.xml file by specifying cancellable="true". Otherwise, you will get this message. [ March 31, 2008: Message edited by: Merrill Higginson ]
|
Merrill
Consultant, Sima Solutions
|
 |
Seetharaman Venkatasamy
Ranch Hand
Joined: Jan 28, 2008
Posts: 5575
|
|
Thanks a lot Merrill thanks & regards, seetharaman
|
 |
Francisco Jimenez
Greenhorn
Joined: Oct 03, 2012
Posts: 2
|
|
My problem is solved with cancellable="true"
|
 |
 |
|
|
subject: Cancell function in Struts(Action class)
|
|
|