你要看你的struts-config.xml配置文件的路径对不对。

解决方案 »

  1.   

    我把我的配置文件贴出来了,还是不清楚是那里的问题。。谢谢两位提点。<?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE struts-config PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 1.1//EN" "http://jakarta.apache.org/struts/dtds/struts-config_1_1.dtd"><struts-config>
    <data-sources /> <form-beans>
    <form-bean name="login/LoginAF"
    type="com.swei.web.login.LoginAF" />
    </form-beans> <global-exceptions /> <global-forwards>
    <forward name="login" path="/login.jsp" />
    <forward name="index" path="/index.jsp" />
    </global-forwards> <action-mappings>
    <action name="login/LoginAF" scope="request" parameter="method"
    path="/login/LoginAction" type="com.swei.web.login.LoginAction">
    <forward name="succeed" path="/index.jsp" />
    </action>
    </action-mappings> <message-resources className="org.apache.struts.action.ActionMessages" parameter="com.swei.commons.properties.ApplicationResources" /> <plug-in className="org.apache.struts.validator.ValidatorPlugIn">
    <set-property property="pathnames"
    value="/WEB-INF/validator-rules.xml,/WEB-INF/validation.xml" />
    </plug-in>
    <!-- 
    <plug-in className="org.apache.struts.tiles.TilesPlugin">
    <set-property property="definitions-config"
    value="/WEB-INF/tiles-defs.xml" />
    </plug-in>
     -->
    </struts-config>
      

  2.   

    这份才是对的,不好意发错了。<?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE struts-config PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 1.1//EN" "http://jakarta.apache.org/struts/dtds/struts-config_1_1.dtd"><struts-config>
    <data-sources /> <form-beans>
    <form-bean name="login/LoginAF"
    type="com.swei.web.login.LoginAF" />
    </form-beans> <global-exceptions /> <global-forwards>
    <forward name="login" path="/login.jsp" />
    <forward name="index" path="/index.jsp" />
    </global-forwards> <action-mappings>
    <action name="login/LoginAF" scope="request" parameter="method"
    path="/login/LoginAction" type="com.swei.web.login.LoginAction">
    <forward name="succeed" path="/index.jsp" />
    </action>
    </action-mappings> <message-resources className="org.apache.struts.action.ActionMessages" parameter="com.swei.commons.properties.ApplicationResources" /> <plug-in className="org.apache.struts.validator.ValidatorPlugIn">
    <set-property property="pathnames"
    value="/WEB-INF/validator-rules.xml,/WEB-INF/validation.xml" />
    </plug-in>
    <!-- 
    <plug-in className="org.apache.struts.tiles.TilesPlugin">
    <set-property property="definitions-config"
    value="/WEB-INF/tiles-defs.xml" />
    </plug-in>
     -->
    </struts-config>
      

  3.   

    你的form name的名字login/LoginAF,不知道这个有没有问题,/代表的是路径的意思,你名字里面有这个会不会有问题,没有这样写过,建议还是改了。<message-resources className="org.apache.struts.action.ActionMessages" parameter="com.swei.commons.properties.ApplicationResources" />不需要指定className,把去掉试一下。
    直接后右面的parameter就可以了。
      

  4.   

    拿个路径应该是没有问题的。应为我在以前的应用同样使用过,至于拿个CLASS是我后来测试的时候加上看看关不关这个事情的,哈哈。去掉了Class以后问题依然啊哈哈。
      

  5.   

    如果在资源文件中加入中文,但是没有对其进行编码(用native2ascii),有可能出现这种问题
      

  6.   

    在配置文件中需要用<data-sources >配置资源文件路径吧。