日期:2014-05-18 浏览次数:20725 次
class DemoAction extends Action { public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) { DemoForm demoForm = (DemoForm) form;// TODO Auto-generated method stub System.out.println("out:"+demoForm.getParam()); //** RequestDispatcher requestDispatcher=request.getRequestDispatcher("http://www.google.cn/search"); try { [color=#FF0000]//试图转发到http://www.google.cn/search,但出错[/color] requestDispatcher.forward(request, response); } catch (ServletException e) { e.printStackTrace(); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } return null; }