我知道一种整合的方式是:
在struts-config.xml中,加入:
<controller processorClass="org.springframework.web.struts.DelegatingRequestProcessor"/>
但是这种方式整合后,我如果想在我的action中做:
ServletContext context=this.getServlet().getServletContext();
则会报空指针,怎么想都想不通,为什么得不到了?何况delegatingRequestProcessor还继承了struts的requestprocessor。
在struts-config.xml中,加入:
<controller processorClass="org.springframework.web.struts.DelegatingRequestProcessor"/>
但是这种方式整合后,我如果想在我的action中做:
ServletContext context=this.getServlet().getServletContext();
则会报空指针,怎么想都想不通,为什么得不到了?何况delegatingRequestProcessor还继承了struts的requestprocessor。
struts-config.xml中,
<action path="/splitPage" scope="request" type="org.springframework.web.struts.DelegatingActionProxy" validate="false">
<forward name="pagelist" path="/pagelistDemo.jsp"></forward>
</action>applicationContext.xml 中,
<bean name="/splitPage" class="com.kingdo.common.test.SplitPageAction" singleton="false">
<property name="pageinate"> //业务层接口和实现类的注入 <ref bean="pageinate" />
</property>
</bean>SplitPageAction 继承 org.apache.struts.action.Action;
重写public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) 方法。
-->
- <listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
web.xml中这个加了没有
http://forum.csdn.net/PointForum/SearchTopic.aspx?bigclassid=00000000-0000-0000-0000-000000000000&smallclassid=df8a1eb4-7ecb-4fcd-a9ae-1be6fd084aeb&searchtype=big&subject=&username=albertadream&pb=pb