Goodspeed

导航

今天踩过的坑——structs和spring

struts

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

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

spring自动加载

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

需要写成struts.objectFactory.spring.autoWire = name

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

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

posted on 2013-11-19 18:01  Goodspeed  阅读(396)  评论(0编辑  收藏  举报