今天踩过的坑——structs和spring

strutsweb

若是实现了CookiesAware了,还须要引用org.apache.struts2.interceptor.CookieInterceptor过滤器,不然拿不到值
同时还要能看到这样的错误No object in the CompoundRoot has a publicly accessible property named 'JSESSIONID'
解决办法是spring

1 把struts.devMode设为false
2 增长一个setJSESSIONID(String value)的空方法apache

spring自动加载this

想按名称加载
写成struts.objectFactory.spring.autoWire = name不行,必须写成struts.objectFactory.spring.autoWire = autospa

须要写成struts.objectFactory.spring.autoWire = nameio

private calculatorService cs;
public void setCs1(calculatorService cs){
this.cs = cs;
}class

<bean id="cs1" class="goodspeed.web.services.calculatorServiceImpl"></bean>struts2

相关文章
相关标签/搜索