您的位置:首页 > 编程语言 > Java开发

struts2框架搭建第三天

2010-10-22 15:58 288 查看
1, Result 的type属性

redirectAction :重定向到一个action
redirect :重定向到界面

dispacher: 转发到jsp(默认)
chain:转发到action (使用此类型转发时在<result>标记内需要加入 <param>标记以制定 ,该转向的action名称和 命名空间。)

例如:
<param type="actionName">action的名字</param>
<param type="namespace">/命名空间的名字</param>

2,拦截器

1,Interceptor 接口

2, AbstractInterceptor 适配器模式(抽象类)

3,MethodFilerInterceptor 进行更细致的过滤 (抽象类)

=================

1,国际化:

i18n:Internationnalization

1,struts.xml
<constant name="struts.custom.i18n.resources" value="globalMessage"></constant>

2,命名规范: properties
globalMessage_en_US.properties
user="UserName"
globalMessage_zh_CN.properties
user="用户名";

3,引入struts2标签

<s:text name="user"></s:text>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: