首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > 编程 >

ActionResources_zh_CN.properties Not Found

2012-09-07 
ActionResources_zh_CN.properties Not Found.控制台报警告:2009-06-30 16:08:02,765 WARN? org.apache.st

ActionResources_zh_CN.properties Not Found.

控制台报警告:
2009-06-30 16:08:02,765 WARN? org.apache.struts.util.PropertyMessageResources -?? Resource org/apache/struts/action/ActionResources_zh_CN.properties Not Found.
?2009-06-30 16:08:02,765 WARN? org.apache.struts.util.PropertyMessageResources -?? Resource org/apache/struts/action/ActionResources_zh.properties Not Found.

这个资源包是struts框架内部的消息资源包,用来想日志文件输出信息,警报和错误信息的,下载的struts包中本来就不包含_zh_CN的资源文件。?
protected void initInternal()?
? ? ? ? throws ServletException {?
? ? ? ? try {?
? ? ? ? ? ? internal = MessageResources.getMessageResources(internalName);?
? ? ? ? } catch (MissingResourceException e) {?
? ? ? ? ? ? log.error("Cannot load internal resources from '" + internalName?
? ? ? ? ? ? ? ? + "'", e);?
? ? ? ? ? ? throw new UnavailableException(?
? ? ? ? ? ? ? ? "Cannot load internal resources from '" + internalName + "'");?
? ? ? ? }?
? ? }?
这个是actionServlet中的init方法初始化时调用的第一个方法,就是获取那个资源文件。默认的值就是internalName= org/apache/struts/action/ActionResources。

?

是Struts1.X程序运行ActionServlet调用initInternal()方法时,?
得到你的机器是中文系统,试图寻找中文的ActionResources_zh_CN.properties文件或者ActionResources_zh.properties文件,由于Struts 1.X 开发包本身没有这两个文件,所以提示出来“警告”,不是错误。 这个警告并不影响程序的运行。?
可以根据英文版的ActionResources.properties做一个中文版的ActionResources_zh_CN.properties,放在相应的路径下。注意转码。

控制台运行?
native2ascii -encoding gb2312 ActionResources.properties ActionResources_zh_CN.properties?

或者建个bat文件,把这句话写进去,运行

热点排行