日期:2014-05-20  浏览次数:20773 次

关于structs框架的问题
我在调用方法的时候报错具体代码如下!
structs-config.xml:
 <action path="/receptionapplication" type="com.nb.adv.report.ReceptionApplicationAction" 
  name="receptionapplicationform" 
  scope="request" parameter="method">
</action>

ReceptionApplicationAction:
public ActionForward execute(ActionMapping mapping, ActionForm form,
  HttpServletRequest request, HttpServletResponse response)
  throws Exception {
  try {
  return super.execute(mapping, form, request, response); } catch (Exception e) {
  log.error(e);
  return mapping.findForward("error");
  }
  }
在调用这句话的时候出错误。。return super.execute(mapping, form, request, response);
execute方法如下:
errors = new ActionErrors();
  saveErrors(request, null);
  request.setCharacterEncoding("GBK");
  response.setContentType("text/html;charset=GBK");

  Object user = request.getSession().getAttribute(Constants.SESSION_USER);
  String jsppage = mapping.findForward(mapping.findForwards()[0]).getPath();到这句就出现问题,直接跳转了。。。求原因啊!!

错误提示:
2011-04-28 01:48:18 701570 ERROR [http-8080-Processor21] com.nb.adv.report.MonthReportAction - java.lang.ArrayIndexOutOfBoundsException: 0

------解决方案--------------------
java.lang.ArrayIndexOutOfBoundsException: 0
应该是mapping.findForwards()[0]这句话问题,打印一下mapping.findForwards().length看看是多少,估计是0!
------解决方案--------------------
myeclipse自己调试