---
title: "struts框架加载Struts2常量顺序"
author: "limit121"
date: "2013-04-05T16:18:29Z"
tags: []
categories: ["企业架构"]
slug: "struts-struts2"
draft: false
lastmod: "2013-04-05T16:18:29Z"
id: 1842275
url: "https://limit121.iteye.com/blog/1842275"
---

通常，Struts2框架按如下搜索顺序加载Struts2常量

struts-default.xml：该文件保存在struts2-core-2.1.2.jar文件中

struts-plugin.xml：该文件保存在struts2-Xxx-2.1.2.jsr等Struts 2插件JAR文件中

struts.xml：该文件是Web应用默认的Struts 2配置文件

struts.properties：该文件是Struts 2默认的配置文件

web.xml：该文件是Web应用的配置文件

如果在多个文件中配置了同一个Struts 2常量，则后一个文件中配置的常量值会覆盖前面文件中配置的常量值。