File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Struts and the fly likes Cancell function in Struts(Action class) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Cancell function in Struts(Action class)" Watch "Cancell function in Struts(Action class)" New topic

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

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");
return mapping.findForward("success");
form=buildEmployeeForm(request.getParameter("employeeid"), request);

HttpSession session=request.getSession();

}catch(Exception ex){System.out.println("ex in GetEmployeAction");}

return mapping.findForward(target);


please any one can explain me..

thanks & regards,
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 ]

Consultant, Sima Solutions
Seetharaman Venkatasamy
Ranch Hand

Joined: Jan 28, 2008
Posts: 5575

Thanks a lot Merrill

thanks & regards,
Francisco Jimenez

Joined: Oct 03, 2012
Posts: 2

My problem is solved with cancellable="true"

I agree. Here's the link:
subject: Cancell function in Struts(Action class)
It's not a secret anymore!