jsf - Unable to disable webpage caching in google chrome -
i have form fields, <p:inputtext>
, <p:selectonemenu>
, trying prevent user navigating previous page, without clearing form fields or request new page, referring this question, tried implement filter:
@webfilter("/*") public class loginfilter implements filter { @override public void dofilter(servletrequest request, servletresponse response, filterchain chain) throws ioexception, servletexception { httpservletrequest req = (httpservletrequest) request; httpservletresponse res = (httpservletresponse) response; //if (!req.getrequesturi().startswith(req.getcontextpath() + resourcehandler.resource_identifier)) { // skip jsf resources (css/js/images/etc) res.setheader("cache-control", "no-cache, no-store, must-revalidate"); // http 1.1. res.setheader("pragma", "no-cache"); // http 1.0. res.setheader("expires", "0"); // proxies. //} removed condition, double check chain.dofilter(request, response); }
i have added autocomplete="off"
fields , added meta data in page:
but every time presses forward/back button, gets old form (with old values) back. works on firefox, not on google chrome. missing something?
Comments
Post a Comment