Action的搜寻顺寻

Action的搜索顺寻

Action的搜索顺寻

http://ip:port/project/package/actionName

 

 

http://localhost:8080/struts2/first/helloworld
http://localhost:8080/struts2/first/wrong1/wrong2/wrong2/helloworld
上列两个地址都可以反问到HelloWorldAction
因为struts2倒序寻找action。
如果连最后一个包都没有找到action,呢么struts2就会到默认的命名空间中寻找action,没有设置package或者设置为空那么就是默认的命名空间