namespace决定了action的访问路径,默认为"",可以接收所有路径的action
namespace可以写为/,或者/xxx,或者/xxx/yyy,对应的action访问路径为/index.action, /xxx/index.action,或者/xxx/yyy/index.action.
namespace最好也用模块来进行命名

View Code
<constant name="struts.devMode" value="true" />
<package name="front" extends="struts-default" namespace="/front">
<action name="index">
<result>/Namespace.jsp</result>
</action>
</package>

 

访问路径:http://localhost:8080/project/front/index

<result name="success">/Namespace.jsp</result>   中的name可以省略。

 

View Code
     <package name="main" extends="struts-default" namespace="">
<action name="index">
<result>/Namespace.jsp</result>
</action>
</package>



namespace为空 则

访问路径:http://localhost:8080/project/....../index   只要包括index 就可以访问。

 

相关文章:

  • 2022-02-20
  • 2021-11-28
  • 2021-08-02
  • 2021-10-16
  • 2021-10-10
  • 2021-10-24
  • 2021-05-16
猜你喜欢
  • 2021-12-01
  • 2021-09-27
  • 2021-08-13
  • 2021-12-03
  • 2018-03-10
  • 2021-12-22
  • 2021-12-27
相关资源
相似解决方案