今天踩過的坑——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

相關文章
相關標籤/搜索