日期:2014-05-20  浏览次数:20714 次

多个properties文件如何配置
项目中有两套properties文件,
一为页面国际化,一为异常信息国际化,
我在struts-config.xml中使用如下配置:
XML code

<message-resources parameter="ApplicationResources" />
    <message-resources parameter="ErrorMessagesResources"
        key="error" />


我在页面中使用<bean:message>两个文件中的信息都可以读出,但在做异常处理时,却读不出异常信息。
我使用以下方法:
<html:errors bundle="error">,前台没有任何提示信息。
后台中我在action中直接抛出异常信息,并在struts-config.xml中捕获异常信息,如下:
XML code

<exception 
    key="add"
    type="java.lang.Exception"
    path="/index.jsp"
/>



请教各位高人,这个该如何配置才对啊,搞了两天了,救命啊!!!!!

------解决方案--------------------
<exception 
key="add"
type="java.lang.Exception"
path="/index.jsp"
/>
既然你指定index.jsp页面负责异常处理,那么应该指定该页面为错误页面吧!