关于SSH启动前的工作报的异常处理小结

Struts2+Spring3+Hibernate3

一般情况下Struts2与Spring3整合时,struts的action给spring管理时要在struts.xml文件加一个<constant name="struts.objectFactory" value="org.apache.struts2.spring.StrutsSpringObjectFactory"/>
或者是<constant name="struts.objectFactory" value="spring"/>,
但是如果想在起动这三个框架之前做一些事情,则可以写一个自己的类extends ObjectFactory类和implements ApplicationContextAware接口来替换StrutsSpringObjectFactory类。


如果用了spring security的org.springframework.web.filter.DelegatingFilterProxy filter,如果会有WebApplicationContext找不到的情况下,则可能是spring没起来,这时,可参照上面的filter重写一个filter,重写里面的doFilter()方法即可。如
if(flag=true){
// Let the delegate perform the actual doFilter operation.
   invokeDelegate(delegateToUse, request, response, filterChain);
}else{
   chain.doFilter(request, response);
}

你可能感兴趣的:(spring,工作,框架,struts,ssh)