1

I am facing a Problem using @SessionScoped in JSF. When traversing from Home.jsf to Dashboard.jsf with some Query String parameters, Dashboard.jsf page is working fine as per the input in QueryString parameter.

But, when i am going back again(BROWSER BACK BUTTON) to Home.jsf and click on some other link for Dashboard.jsf, the same is not updating the Page as per the Query String. It is displaying me the Same page i requested previously.

When i debug the code, i observed, that on first request it is going to code behind PageBean(Dashboard.jsf), but, on another request, it's not.

I don't want to use @RequestScoped and @ViewScoped because i've to maintain the values in the Session.

Can anybody suggest how can i render the Dashboard.jsf on every request?

Please Suggest.

  • 1
    possible duplicate of [JSF Back Button Refresh Page](http://stackoverflow.com/questions/14101380/jsf-back-button-refresh-page) – BalusC Jan 28 '13 at 18:40
  • Thanks for your inputs. I added this to my JSF that it should not maintain Cache in Browser . But, Still it is maintaining. – Hitesh Kumar Jan 28 '13 at 19:07
  • Meta http-equiv tags are only used when the page is loaded from disk via `file://`, not when page is served over HTTP via `http://`. Instead, the actual HTTP response headers are been used. See also http://stackoverflow.com/questions/49547/making-sure-a-web-page-is-not-cached-across-all-browsers/2068407#2068407 In other words, try to not think that you know it better and do things differently than shown in the linked duplicate answer :) – BalusC Jan 28 '13 at 19:19
  • Thanks for it. Let me give it a try. – Hitesh Kumar Jan 28 '13 at 19:22
  • I tried to create a **'NoCacheFilter'** as you specified in above post and added to web.xml: `facesServlet` in web.xml. But same problem persists. I think i have to do some research on that why it is happening. Anyways, Thanks for your support! – Hitesh Kumar Jan 28 '13 at 20:51
  • Does the servlet name in the filter mapping match the servlet name of your faces servlet as you've definited in web.xml yourself? Some IDEs autogenerate or some users use "Faces Servlet" as servlet name instead. – BalusC Jan 28 '13 at 20:54
  • Yes, my filter `@WebFilter(servletNames={"facesServlet"})` web.xml entry **facesServlet** – Hitesh Kumar Jan 28 '13 at 20:55
  • Is the `doFilter()` method invoked? Have you cleared your browser cache before testing? – BalusC Jan 28 '13 at 21:01

0 Answers0