动态方法调用:
1.第一种方法
<wbr><wbr><wbr><wbr></wbr></wbr></wbr></wbr>在请求地址后加查询字符串属性指定调用方法的名称,格式如下:
<wbr></wbr><wbr></wbr>method:{调用方法名}
<wbr><wbr><wbr><wbr></wbr></wbr></wbr></wbr>示例:
<wbr></wbr>http://localhost:8080/web/test/simple.action?method:addInput
<wbr><wbr><wbr><wbr></wbr></wbr></wbr></wbr>或在表单中添加指定请求方法的表单域,一般用隐藏域。
<wbr><wbr><wbr><wbr></wbr></wbr></wbr></wbr>示例:
<wbr></wbr>
复制代码
1
2
3
4
5
6<form action="/web/test/simple.action" method="post"> <input type="hidden" name="method:add"/> UserName:<input name="username"/><br/> Password:<input name="password" type="password"/><br/> <input type="submit" value="提交"/> </form>
或
复制代码
1
2
3
4
5<form action="/web/test/simple.action" method="post"> UserName:<input name="username"/><br/> Password:<input name="password" type="password"/><br/> <input type="submit" name="method:add" value="提交"/> </form>
2.第二种方法
<wbr></wbr>示例:
http://localhost:8080/web/test/simple!addInput.action
最后
以上就是高贵哑铃最近收集整理的关于调用action的方法的全部内容,更多相关调用action内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复