You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by bu...@apache.org on 2003/04/17 02:32:36 UTC

DO NOT REPLY [Bug 19100] New: - nocache attribute is not working when set to false.

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=19100>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=19100

nocache attribute is not working when set to false.

           Summary: nocache attribute is not working when set to false.
           Product: Struts
           Version: 1.1 RC1
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: Controller
        AssignedTo: struts-dev@jakarta.apache.org
        ReportedBy: haichen@yahoo.com


Hello,

I found out that when the no cache option is set to false, struts is still 
sending headers with cache set to no-cache. I traced the problem into 
org.apache.struts.action.RequestProcessor.java. I had to add an "else" section 
in the processNoCache method to fix the problem.
 
    protected void processNoCache(HttpServletRequest request,
                                  HttpServletResponse response) {

        if (moduleConfig.getControllerConfig().getNocache()) {
            response.setHeader("Pragma", "No-cache");
            response.setHeader("Cache-Control", "no-cache");
            response.setDateHeader("Expires", 1);
        }
	    else
        {
            response.setHeader("Pragma", "cache");
            response.setHeader("Cache-Control", "cache");
        }

    }

---------------------------------------------------------------------
To unsubscribe, e-mail: struts-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-dev-help@jakarta.apache.org