java控制action缓存问题?

谁有Shop++商城的源码不,发我邮箱409060808@qq.com。
2025-06-24 02:00:22
推荐回答(4个)
回答1:

Action实现ServletResponseAware接口得到HttpServletResponse
response.setHeader( "Pragma", "no-cache" );
response.setDateHeader("Expires", 0);
response.addHeader( "Cache-Control", "no-cache" );
response.addHeader( "Cache-Control", "no-store" );
response.addHeader( "Cache-Control", "must-revalidate" );

回答2:

具体啥问题。
但是既然你说action。那么我就认为是struts了
action只是起跳转作用,不需要缓存。
需要缓存的是你的业务跟数据库。
并且缓存不是随便用的。有适用场景。
先弄清楚你的需求再补充下问题吧。

回答3:

action只是进行业务逻辑处理和页面跳转和servlet差不多,应该不关缓存什么问题吧

回答4:

问题不清楚???表示很无力!