Struts.xml namespace
[size=medium]Struts.xml文件中:
<package name="default" namespace="" extends="struts-default">
<action name="hello">
<result>
/Hello.jsp
</result>
</action>
</package>
Namespace的值對應訪問action的路徑,若namespace爲/, /aaa, /aaa/bbb,則對應的action訪問路徑爲:/hello, /aaa/hello, /aaa/bbb/hello。
若不寫,默認namespace=””,可以接收所有路徑下的action,如action訪問路徑爲:/hello, /aaa/hello, /aaa/bbb/hello,都會訪問到Hello.jsp。
[/size]
<package name="default" namespace="" extends="struts-default">
<action name="hello">
<result>
/Hello.jsp
</result>
</action>
</package>
Namespace的值對應訪問action的路徑,若namespace爲/, /aaa, /aaa/bbb,則對應的action訪問路徑爲:/hello, /aaa/hello, /aaa/bbb/hello。
若不寫,默認namespace=””,可以接收所有路徑下的action,如action訪問路徑爲:/hello, /aaa/hello, /aaa/bbb/hello,都會訪問到Hello.jsp。
[/size]
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章
Struts2day04判斷用戶是否登錄
Tyan520
2020-07-08 07:40:48
Struts2day04Struts2.0文件的下載
Tyan520
2020-07-08 07:40:48
struts2day05異常處理
Tyan520
2020-07-08 07:40:46
Struts2day04Struts2.0文件的上傳
Tyan520
2020-07-08 07:40:43
struts.xml配置,三種調用方法的配置
wkj888888
2020-07-07 10:01:44
動態結果配置:struts.xml中,屬性的type配置之redirectAction(請求重定向到指定的Action)
wkj888888
2020-07-07 10:01:44
Struts2自學入門(二)
PleaseLieToMe
2020-07-07 06:13:13
Struts2自學入門(一)
PleaseLieToMe
2020-07-07 06:13:13
Struts2中動態的result
-江南听雨-
2020-07-06 03:44:44
Struts2學習——0400ActionWildCard通配符配置
Do_It_Today
2020-07-06 00:02:26
Struts2學習——0300DMI動態方法調用
Do_It_Today
2020-07-05 23:20:48
Struts2學習——1400OGNL2訪問方法與屬性
Do_It_Today
2020-07-05 23:20:48
Struts2學習——0900DefaultAction 默認Action
Do_It_Today
2020-07-05 23:20:37
修改Struts2表單錯誤提示的顯示樣式
forGongyuan
2020-07-05 06:06:01