日期:2014-05-18  浏览次数:20586 次

struts token的问题,
1,public   ActionForward   execute(ActionMapping   mapping,   ActionForm   form,HttpServletRequest   request,   HttpServletResponse   response)
throws   Exception   {
this.saveToken(request);

return   mapping.findForward( "test ");
//test跳到list.jsp
}
2,   <form   name= "form1 "   method= "post "   action= "insert.do ">
          名:    
              <input   name= "name "   type= "text "   id= "name "> <br>
  密码:
    <input   name= "password "   type= "text "   id= "password ">
              <br> <input   type= "submit "   name= "Submit "   value= "提交 ">
                                                </form>
3,
public   ActionForward   execute(ActionMapping   mapping,   ActionForm   form,
HttpServletRequest   request,   HttpServletResponse   response)
throws   Exception   {
Testform   forme   =   (Testform)   form;
String   name   =   forme.getName();
System.out.println(name);
String   token   =   request
.getParameter( "org.apache.struts.taglib.html.token ");
System.out.println(token);

return   mapping.findForward( "test ");

}

输出为null;为什么,大家帮忙



------解决方案--------------------
http://blog.csdn.net/whirlsun/archive/2007/01/15/1484021.aspx