oscache的下载地址 将jar包拷贝到项目的lib中 修改webxml文件加入如下几行 <filter> <filtername>encodingFilter</filtername> <filterclass> orgspringframeworkwebfilterCharacterEncodingFilter </filterclass> <initparam> <paramname>encoding</paramname> <paramvalue>UTF</paramvalue> </initparam> <initparam> <paramname>forceEncoding</paramname> <paramvalue>true</paramvalue> </initparam> </filter> <filter> <filtername>cacheFilter</filtername> <filterclass> comopensymphonyoscachewebfilterCacheFilter </filterclass> <initparam> <paramname>time</paramname> <paramvalue></paramvalue> </initparam> <initparam> <paramname>scope</paramname> <paramvalue>session</paramvalue> </initparam> </filter> <filtermapping> <filtername>encodingFilter</filtername> <urlpattern>*do</urlpattern> </filtermapping> <filtermapping> <filtername>encodingFilter</filtername> <urlpattern>*jsp</urlpattern> </filtermapping> <filtermapping> <filtername>cacheFilter</filtername> <urlpattern>*do</urlpattern> </filtermapping> 其中特别要注意encode的filter要放在cache filter前面这样就不会有乱码问题 拷贝oscacheproperties到classpath下面 |