Struts2 入门:表单提交、验证、类型转换与测试
1. 表单提交
在完成表单的基本设置后,只需输入名称并点击“提交”按钮即可。提交表单时,调用的 action 是 helloWorld ,对应的 URL 为 http://localhost:8080/app/helloWorld.action 。
在 struts.xml 配置文件中, helloWorld 这个 action 的定义如下:
<struts>
<package name="myPackage" extends="struts-default">
…
<action name="helloWorld" class="helloWorldAction">
<result name="input">/jsp/index.jsp</result>
<result>/jsp/helloWorld.jsp</result>
</action>
</package>
</struts>
与之前的 action 不同的是, helloWorld action 的创建委托给了 Spring 框架。 helloWorldAction
超级会员免费看
订阅专栏 解锁全文
11

被折叠的 条评论
为什么被折叠?



