猜数字,struts2改写遇到的问题。

来源:互联网 发布:雅可比矩阵中的d 编辑:程序博客网 时间:2024/05/16 09:54

猜数字,struts2改写遇到的问题。

 

原代码:

 <form action="/simplejeeStudy/numberGuess.action?method:check" method="post">
  请输入1-100之间的数值: <input type="text" name="guessNum" ></input>
     <input type="submit" />
 </form>

 

问题:

<form action="/simplejeeStudy/numberGuess.action?method:check" method=?>

 

如果不写method或method=“get”,

?后面的method:check就不会传过去,传过去的是

 

http://localhost:9090/simplejeeStudy/numberGuess.action?guessNum=10

(guessNum=10 是表单中的数据)

 

method=“post”,发过去的才是正确的请求

http://localhost:9090/simplejeeStudy/numberGuess.action?method:check

原创粉丝点击