Hi, I have been converting an old Struts 1x Application to integrate with Spring using the DelegatingActionProxy. When trying to get the servlet context from my struts action using the getServlet().getServletContext(), it is returning null for getServlet(). This does not happen when I do not use the DelegatingActionProxy.
struts config:
application context (web):Code:<action name="aForm" path="/anAction" type="org.springframework.web.struts.DelegatingActionProxy" scope="request"> <forward name="success" path=".pages.aPage" /> </action>
action class:Code:<bean name="/anAction" class="com.xxx.xxx.web.action.AnAction"> <property name="someService" ref="someService" /> </bean>
Code:... public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { ... // Get Servlet is returning null getServlet() } ...


Reply With Quote