首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 软件管理 > 软件架构设计 >

Struts2 type 的功用

2012-09-10 
Struts2 type 的作用一、jsp直接跳转到jspaction nametopUI//不写class就直接跳到jspresult/WEB-INF

Struts2 type 的作用

一、jsp直接跳转到jsp<action name="topUI">//不写class就直接跳到jsp    <result>/WEB-INF/pages/front/top.jsp</result></action><result type="redirect">/view.jsp?id=${action中的同名属性}</result>//用这种方式可以传递action中的参数到页面二、action跳到action1.需要保存前一个action的属性信息时使用: <result type= "chain">action2</result> 2.不保存前一个action的属性信息时使用: <result type= "redirect-action">action2</result>//struts2.1.6以后使用type=redirectAction方式<result name="success" type="redirectAction">actionName</result>//同一个包下的action<result name="success" type="redirectAction">//不同包下的action     <param name="actionName">indexUI</param>     <param name="namespace">/main</param>//跳到别的命名空间中的action</result>三、type="plainText"输出源代码到页面<result name="showSource" type="plainText"><param name="location">/xxx.jsp</param><param name="charSet">UTF-8</param>//指定读取文件的编码</result>

?

热点排行