资源文件如下:
welcome.title = Struts Logon Example Application
welcome.heading = Welcome!
welcome.message = To get started on your own application,copy the struts-blank.war to a new WAR file using the name for your
application.Place it in your container's "webapp" folder (or equivalent),and let your container auto-deploy the application Edit
skeleton configuration files as needed,reload Struts or restart your container,and you are on your way!(You can find
application.properties file with this message in the <B>/WEB-INF/src/java/resources</B> folder.)
errors.footer = </UL><HR>
errors.header = <H3><FONT color="red">Validation Error</FONT></H3>You must correct the following error(3) before
proceeding:<UL>
error.username.required = <LI>Username is required</LI>
error.password.required = <LI>Password is required</LI>
error.logon.invalid = <LI>Username and password provided not found inuser directory.Password must match exactly,including;
lower or upper case characters.</LI>
error.logon.connect = <LI>Could not connect to user directory.</LI>感觉没有问题啊!!

解决方案 »

  1.   

    资源文件放在WEB-INF/classes下
    如果你的资源文件名为:ApplicationResources.properties
    在struts-config.xml中配置如下:
    <struts-config>
    .....
        <message-resources parameter="ApplicationResources" />
    </struts-config>
      

  2.   

    哎呀,楼上大哥谢谢你啦,问题好像解决了,但我还有点不明白的是,我以为在web.xml里设置ApplicationResources呢!我的web.xml
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <!DOCTYPE web-app 
      PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" 
      "http://java.sun.com/j2ee/dtds/web-app_2_3.dtd">
    <web-app>
      <servlet>
       <servlet-name>action</servlet-name>
       <servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
       <init-param>
         <param-name>ApplicationResources</param-name>
         <param-value>com.youcompany.struts.ApplicationResources</param-value>
       </init-param>
       <init-param>
         <param-name>coinfig</param-name>
         <param-value>/WEB-INF/struts-config.xml</param-value>
       </init-param>
       <init-param>
         <param-name>debug</param-name>
         <param-value>2</param-value>
       </init-param>
       <init-param>
         <param-name>detail</param-name>
         <param-value>2</param-value>
       </init-param>
       <load-on-startup>2</load-on-startup>
       </servlet>
       <servlet-mapping>
       <servlet-name>action</servlet-name>
       <url-pattern>*.do</url-pattern>
       </servlet-mapping>
       <welcome-file-list>
         <welcome-file>index.jsp</welcome-file>
       </welcome-file-list>
       <taglib>
         <taglib-uri>/tags/struts-html</taglib-uri>
         <taglib-location>/WEB-INF/struts-html.tld</taglib-location>
       </taglib>
    </web-app>这里的<init-param>
         <param-name>ApplicationResources</param-name>
         <param-value>com.youcompany.struts.ApplicationResources</param-value>
       </init-param>
    不是在指定资源文件吗?而且我用的eclipse的easystruts不允许更改ApplicationResources!!
    我有很多很糊涂的,还忘东东赐教,加我MSN:[email protected]
      

  3.   

    <init-param>
         <param-name>application</param-name><!--here should be application-->
         <param-value>com.youcompany.struts.ApplicationResources</param-value>
       </init-param>