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 4058442
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T15:04:48+00:00 2026-05-20T15:04:48+00:00

I use JSF 1.2. I have a view in which I have a h:commandButton

  • 0

I use JSF 1.2. I have a view in which I have a h:commandButton with the following action:

#{myBean.saveSomeData}

When I click on the button, I want to save some data and like the data that are saved can change the display of my view, i would like to force hard reload (like a CTRL+F5 in my browser for example) of my page.

To do that, I thought to this code :

public void saveSomeData() {
            ... Save some data ... 

        FacesContext context = FacesContext.getCurrentInstance();
        String viewId = context.getViewRoot().getViewId();
        ViewHandler handler = context.getApplication().getViewHandler();
        UIViewRoot root = handler.createView(context, viewId);
        root.setViewId(viewId);
        context.setViewRoot(root);
}

But when i do that, the tree components of my view is not reloaded.

So, I don’t know how to do that reload. Someone would have any idea about the way to do that ?

Thanks by advance for your help.

Sylvain.

  • 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-05-20T15:04:49+00:00Added an answer on May 20, 2026 at 3:04 pm

    Add no-cache headers to the response so that the browser never caches the page. You can do this with a Filter which is mapped on the url-pattern of interest. For example *.jsf or just on the FacesServlet. Let the Filter set the following headers in the doFilter() method:

    response.setHeader("Cache-Control", "no-cache, no-store, must-revalidate"); // HTTP 1.1.
    response.setHeader("Pragma", "no-cache"); // HTTP 1.0.
    response.setDateHeader("Expires", 0); // Proxies.
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to use CDI for my JSF/Java EE application. I have the following
I want to generate some html code for the jsf page I have (I
All the tutorials I have seen seem to use *.jsf , *.faces , or
Does anybody know which JSF version is most suitable to use when deploying to
I have a JSF/RichFaces setup with an index.jsp which a4j:include s another piece of
I read somewhere the view ids used by JSF framework have a happy side
I have a (JSF 2.0/ Primefaces 2.2RC-SNAPSHOT) app that has <p:layout> I use a
In my JSF 1.2 webapp I have a page with a <h:commandButton> that invokes
Is JSF being used in the enterprise, or at least growing in use?
I would like to use JavaScript to manipulate hidden input fields in a JSF/Facelets

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.