日期:2014-05-17 浏览次数:20715 次
<?xml version="1.0" encoding="UTF-8"?><web-app xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.5"<jsp-config> <taglib> <taglib-url>/WEB-INF/struts-bean.tld</taglib-url> <taglib-location>/WEB-INF/struts-bean.tld</taglib-location> </taglib> <taglib> <taglib-url>/WEB-INF/struts-html.tld</taglib-url> <taglib-location>/WEB-INF/struts-html.tld</taglib-location> </taglib> <taglib> <taglib-url>/WEB-INF/struts-logic.tld</taglib-url> <taglib-location>/WEB-INF/struts-logic.tld</taglib-location> </taglib> </jsp-config> </web-app>
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE struts-config PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 1.2//EN" "http://struts.apache.org/dtds/struts-config_1_2.dtd"> <struts-config> <data-sources /> <form-beans> <form-bean name="publicFrom" type="org.apache.struts.validator.DynaValidatorActionForm"> <form-property name="title" type="java.lang.String" /> </form-bean> </form-beans> <global-exceptions /> <global-forwards> <forward name="login" path="/login.jsp" /> </global-forwards> <action-mappings> <!-- 登录 --> <action path="/login" type="org.springframework.web.struts.DelegatingActionProxy" name="publicFrom" scope="request" parameter="method"> <forward name="success" path="/index.jsp" /> <forward name="login" path="/login.jsp" /> </action> </action-mappings> <message-resources parameter="com.un.struts.ApplicationResources" /> <plug-in className="org.apache.struts.validator.ValidatorPlugIn"> <set-property property="pathnames" value="/WEB-INF/validator/validator-rules.xml,/WEB-INF/validator/validation.xml" /> </plug-in> </struts-config>
------解决方案--------------------
上面的 struts-config.xml
下面是web.xml
<?xml version="1.0" encoding="UTF-8"?> <web-app xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.4" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"> <servlet> <servlet-name>log4j-init</servlet-name> <servlet-class>com.un.filter.Log4jInit</servlet-class> <init-param> <param-name>log4j</param-name> <param-value>WEB-INF/classes/log4j.properties</param-value> </init-param> <load-on-startup>1</load-on-startup> </servlet> <!-- sping配置 --> <context-param> <param-name>contextConfigLocation</param-name> <param-value> /WEB-INF/config/spring/applicationContext-service.xml </param-valu