1、http://localhost:8080/s2_01_HCM_02/test/helloworld可以访问
test:包的命名空间 helloworld:action名称
2、http://localhost:8080/s2_01_HCM_02/test/asdfasd/asdfad/asdf/helloworld也可以访问
顺序:/test/asdfasd/asdfad/asdf(看看这个命名空间下有没有,没有的话)---/test/asdfasd/asdfad/依次往上找
3、以http://localhost:8080/s2_01_HCM_02/test/helloworld为例,
假如存在/test命名空间,但是该命名空间下没有对应为helloworld的action,
那么就会到默认命名空间(namespace=""或者不写)下找,如果没有,则报错404
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE struts PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
"http://struts.apache.org/dtds/struts-2.0.dtd">
<struts>
<package name="it" namespace="/test" extends="struts-default">
</package>
<!--
以下写法相当于<package name="itcast" namespace="" extends="struts-default">,即默认命名空间
-->
<package name="itcast" extends="struts-default">
<action name="helloworld" class="cn.itcast.action.HelloWorldAction" method="execute">
<result name="success">/WEB-INF/page/hello.jsp</result>
</action>
</package>
</struts>