struts2结果类型
                                                            生活随笔
收集整理的這篇文章主要介紹了
                                struts2结果类型
小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.                        
                                ?
<?xml?version="1.0"?encoding="UTF-8"?> <!DOCTYPE?struts?PUBLIC "-//Apache?Software?Foundation//DTD?Struts?Configuration?2.3//EN" "http://struts.apache.org/dtds/struts-2.3.dtd"> <struts> <package?name="resulttype"?namespace="/resulttype"?extends="struts-default"> <default-action-ref?name="helloWorldAction"></default-action-ref> <action?name="resulttypeAction"?class="cn.itcast.resulttype.ResulttypeAction"> <!--?方法一?默認(rèn)為轉(zhuǎn)發(fā), *type:指定結(jié)果類型,默認(rèn)為轉(zhuǎn)發(fā)"dispatcher"? --> <!--?<result?name="success"?type="dispatcher">/resulttype/success.jsp</result>--> <!--?方法二?--> <!--?<result?name="success"?type="dispatcher"> param:參數(shù) *name:參數(shù)的名稱為"location" 實際上,是struts2框架底層的StrutsResultSupport類的setLocation()提供的 *?所謂的參數(shù),應(yīng)該是set方法或者get方法后面跟的名稱才是參數(shù)名 <param?name="location">/resulttype/success.jsp</param> </result>?--> <!--?重定向到j(luò)sp:org.apache.struts2.dispatcher.ServletRedirectResult?--> <!--?<result?name="success"?type="redirect"> <param?name="location">/resulttype/success.jsp</param> </result>?--> <!--?重定向到action?--> <result?name="success"?type="redirectAction"> <!--? param: *actionName:指定"目的地"動作的名字。指定的是Struts.xml文件action標(biāo)簽的name屬性的值 *namespace:指定的是struts.xml文件,action對應(yīng)的package下的namespace屬性的值 --> <param?name="actionName">helloWorldAction</param> <param?name="namespace">/primer</param> </result> </action> </package> </struts>?
總結(jié)
以上是生活随笔為你收集整理的struts2结果类型的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
 
                            
                        - 上一篇: javax.el.ELException
- 下一篇: Struts2中jsp page=xxx
