当前位置: 代码迷 >> Java Web开发 >> struts token的有关问题
  详细解决方案

struts token的有关问题

热度:58   发布时间:2016-04-17 14:46:55.0
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
  相关解决方案