Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8880187
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T20:07:14+00:00 2026-06-14T20:07:14+00:00

I have JSF pages which have links to other JSF pages . When I

  • 0

I have JSF pages which have links to other JSF pages . When I click on the link and if the session has already expired , control goes to login page. And I will login with username password and again come to same page where I have clicked on link. Now I will click on the link, a blank page is getting displayed, and if i do page refresh by F5, the expected page loads.

And also I have checked the console on my Jboss server, the View Expired exception is not appearing.

SO I am bit confused which way I handle this to avoid blank page getting displayed.

Please help.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T20:07:15+00:00Added an answer on June 14, 2026 at 8:07 pm

    This can happen if you’re performing link navigation by ajax and the page returned after login was been served from the browser cache (and thus contains a form with an outdated view state identifier). You need to tell the browser to not cache restricted pages. You can achieve this with the following filter:

    @WebFilter(servletNames={"Faces Servlet"})
    public class NoCacheFilter 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.setDateHeader("Expires", 0); // Proxies.
            }
    
            chain.doFilter(request, response);
        }
    
        // ...
    }
    

    Note that this problem thus also suggests that you’re using (ajax) command links for page-to-page navigation. This is a bad practice. Those links are not SEO friendly nor bookmarkable. Command links should be used for form submits only. Use normal links for page-to-page navigation. See also When should I use h:outputLink instead of h:commandLink?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a JSF application which have several JSF pages. When I click on
I have a JSF page that is included in other JSF pages (basically a
I have a portlet which opens a popup on click of link on it.
My web application has two search pages - search1.jsf and search2.jsf - which share
I'm working on a jsf project, and I have several xhtml pages which use
i have a jsf page which displays an image from an url http://ichart.finance.yahoo.com/z?s=^NSEI&t=1d&q=l&l=on&z=l&p=s&a=v&p=s i
I have created a JSF 2 page which uses Facelets to define the structure
I have several jsf pages. I need to add dynamic breadcrumbs to the header.xhtml.
I have problem with setting proper charset on my jsf pages. I use MySql
If I have a JSF page that I want to link to where I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.