level 2
符文工房DS
楼主
感觉配置没问题呀,求大神帮忙看一下。
struts.xml
<struts>
<constant name="struts.objectFactory" value="spring"/>
<constant name="struts.objectFactory.spring.autoWire" value="true"/>
<package name="user" namespace="/user" extends="default">
<action name="login" class="/user/login">
<result name="success">/welcome.jsp</result>
</action>
</package>
</struts>
web.xml
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>
classpath:applicationContext-dao.xml
classpath:applicationContext-action.xml
</param-value>
</context-param>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<listener>
<listener-class>org.springframework.web.context.request.RequestContextListener</listener-class>
</listener>
<filter>
<filter-name>struts2</filter-name>
<filter-class>org.apache.struts2.dispatcher.FilterDispatcher</filter-class>
</filter>
<filter>
<filter-name>struts-cleanup</filter-name>
<filter-class>org.apache.struts2.dispatcher.ActionContextCleanUp</filter-class>
</filter>
<filter-mapping>
<filter-name>struts-cleanup</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<welcome-file-list>
<welcome-file>/login.jsp</welcome-file>
</welcome-file-list>
login.jsp
<form action="/user/login.action" method="post"></form>
applocationContext-action.xml
<bean name="/user/login" class="action.LoginAction" scope="request">
<property name="userDao" ref="userDao"></property>
</bean>
卡了很长时间了,就是找不到原因,struts.xml放在src目录下了,web.xml在WEB-INF目录下。跪求解答
2014年06月25日 16点06分
1
struts.xml
<struts>
<constant name="struts.objectFactory" value="spring"/>
<constant name="struts.objectFactory.spring.autoWire" value="true"/>
<package name="user" namespace="/user" extends="default">
<action name="login" class="/user/login">
<result name="success">/welcome.jsp</result>
</action>
</package>
</struts>
web.xml
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>
classpath:applicationContext-dao.xml
classpath:applicationContext-action.xml
</param-value>
</context-param>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<listener>
<listener-class>org.springframework.web.context.request.RequestContextListener</listener-class>
</listener>
<filter>
<filter-name>struts2</filter-name>
<filter-class>org.apache.struts2.dispatcher.FilterDispatcher</filter-class>
</filter>
<filter>
<filter-name>struts-cleanup</filter-name>
<filter-class>org.apache.struts2.dispatcher.ActionContextCleanUp</filter-class>
</filter>
<filter-mapping>
<filter-name>struts-cleanup</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<welcome-file-list>
<welcome-file>/login.jsp</welcome-file>
</welcome-file-list>
login.jsp
<form action="/user/login.action" method="post"></form>
applocationContext-action.xml
<bean name="/user/login" class="action.LoginAction" scope="request">
<property name="userDao" ref="userDao"></property>
</bean>
卡了很长时间了,就是找不到原因,struts.xml放在src目录下了,web.xml在WEB-INF目录下。跪求解答