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

请教org.springframework.web.context.ContextLoaderListener配置struts2和spring以及路径关系
--------------------------------web.xml----------------

利用org.springframework.web.context.ContextLoaderListener在web.xml中已经配置好。
<listener>
<listener-class>
org.springframework.web.context.ContextLoaderListener
</listener-class>
</listener>

---------------------------struts.xml-------------------------------------

<struts>
<package name="struts2" extends="struts-default">
<action name="login" class="loginAction">
<result name="input">/index.jsp</result>
<result name="success">/result.jsp</result>
</action>
</package>
</struts> 
-------------------------------applicationContext.xml------------------------
<bean id="loginDao" class="com.test.Dao.LoginDaoImpl">
</bean>  
  <bean name="loginAction" class="com.test.Action.Login" scope="prototype">
  <property name="loginDao" ref="loginDao"/>
</bean>

------解决方案--------------------
太复杂了 不清楚