---
title: "struts2 package namespace限制"
author: "javaeye_hua"
date: "2012-06-13T16:07:14Z"
tags: []
categories: ["企业架构"]
slug: "struts2-package-namespace"
draft: false
lastmod: "2012-06-13T16:06:48Z"
id: 1560083
url: "https://javaeye-hua.iteye.com/blog/1560083"
---

struts2加入package、namespace

其中：

1\. package：对result限制，主要体现在&lt;global-results&gt;上。该包内的action返回result使用到global-result时，在此包范围内查找，其他包范围内部可见！

namespace：主要对action访问限制。在action访问前天就命名空间。

相同的命名空间下，不能出现重复的action定义、不同的命名空间下可以有同名的action定义

2\. 不同的包可以使用不同的命名空间、不同的包也可以使用相同的命名空间