struts2.0传递中文参数,action重定向传中文参数,redirectAction传中文参数
2016-02-24 13:38
519 查看
一.action重定向
1.action 里面编码:
selTeam ="二期";
selTeam =java.net.URLEncoder.encode(selTeam,
"UTF-8");
2.struts.xml中配置:
<result
name="toBespeakList"type="redirectAction">
<param name="actionName">bespeak_list</param>
<param
name="selTeam">${selTeam}</param>
</result>
3.目标action中解码:
if(selTeam !=
null)
{
selTeam = java.net.URLDecoder.decode(selTeam,
"UTF-8");
}
二.<s:a></s:a>URL传中文参数:
1.URL中编码:
<s:a
action="examination_addUI">连接
<s:param
name="selTeam"
value="%{@java.net.URLEncoder@encode(‘中文’,'UTF-8')}"
/>
</s:a>
2.Action中解码:
if(selTeam !=
null)
{
selTeam = java.net.URLDecoder.decode(selTeam,
"UTF-8");
}
1.action 里面编码:
selTeam ="二期";
selTeam =java.net.URLEncoder.encode(selTeam,
"UTF-8");
2.struts.xml中配置:
<result
name="toBespeakList"type="redirectAction">
<param name="actionName">bespeak_list</param>
<param
name="selTeam">${selTeam}</param>
</result>
3.目标action中解码:
if(selTeam !=
null)
{
selTeam = java.net.URLDecoder.decode(selTeam,
"UTF-8");
}
二.<s:a></s:a>URL传中文参数:
1.URL中编码:
<s:a
action="examination_addUI">连接
<s:param
name="selTeam"
value="%{@java.net.URLEncoder@encode(‘中文’,'UTF-8')}"
/>
</s:a>
2.Action中解码:
if(selTeam !=
null)
{
selTeam = java.net.URLDecoder.decode(selTeam,
"UTF-8");
}
相关文章推荐
- Struts - 标签库
- struts1.0于struts2.0的比较
- Struts2中关于namespace的学习心得
- Struts2----自定义action的学习心得
- HTTP Status 404 - There is no Action mapped for namespace [/] and action name [login!welcome] associ
- struts2
- struts 学习笔记
- struts2框架架构流程
- struts2.0拦截器(实现未登录的用户不能访问系统的页面)(转)
- Struts2+jQuery+JSON实现异步交互
- 软件开发疑惑解答
- ajax ssh 整合
- struts2 @Action给方法注解
- struts2登陆拦截器
- struts2框架原理
- web.xml
- web.xml
- struts2框架原理
- struts2登陆拦截器
- struts2 @Action给方法注解