1

In my struts application i want to pass the null value to the mapping.findForward('null') the reason to do this is that i do not want to call any jsp page

More details

public ActionForward saveSurveyTakersDetails(ActionMapping mapping, ActionForm form,
    HttpServletRequest request, HttpServletResponse response)
    throws Exception
    { 
     // something
     return mapping.findForward(null);
     }

Is it is valid to pass null at findForward parameter.. Please answer thanks

Satya
  • 1,421
  • 4
  • 19
  • 32

2 Answers2

1

It's no problem returning null in an action to prevent redirecting to a JSP page, but I would suggest leaving out the findForward() call and just return null outright:

public ActionForward saveSurveyTakersDetails(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response) throws Exception { 
    // something
    return null;
}

It will have the same result, but is a little easier understand at a glance.

seanhodges
  • 17,426
  • 15
  • 71
  • 93
0

Simply returning null (as opposed to finding a forward of "null") from the saveSurveyTakersDetails method should accomplish what you are attempting.

Andy
  • 1