Hi Duncan,
 
We also struggled with this issue when we started using JSF.  In our case, it was because the backing beans have 'session' scope and the session hangs around for a long time.  So we would continually stop/start the server to workaround this.
 
But now we have gotten far enough along on the project that we are managing our session data better.  And we put an h:commandLink in our header called "Reset" (only present while we develop) that will reset the session, e.g.
 
<h:commandLink id="rmReset" actionListener="#{dataSessionUser.resetSession}">
  <h:outputText value="Reset"/>
</h:commandLink>
 
And the resetSession listener looks like:
 
public void resetSession(ActionEvent e) {
  FacesContext fc = FacesContext.getCurrentInstance();
  ExternalContext ec = fc.getExternalContext();
  HttpSession hs = (HttpSession)ec.getSession(false);
  if (hs != null) {
   hs.invalidate();
  }
}
After this, you still need to do a browser reload for things to work 100% correctly.  But at least you don't need to stop/start the server.
 
Note that in our own implementation we got a little fancier and used a navigation rule to load a "reset" page when Reset is clicked.  And that page has a link that reloads our app, so this forces the reload.
 
Hope that helps.
Don


From: Duncan Krebs [mailto:[EMAIL PROTECTED]
Sent: Wednesday, July 27, 2005 1:43 PM
To: [email protected]
Subject: Bypassing restoreview during development

Hi,

I’m working on designing the layout for a faces view and I’m finding that its annoying to get the changes to show up on the page after saving the jsp page and clicking on refresh. It seems like MyFaces is restoring the old view and not updating the new view. For example if I change a value attribute on a output tag the rendered page is still shows the old value. Also, when adding new components to the view I’m getting error messages complaining about the ID.

 

I guess what I’m wondering is there anyway I can configure MyFaces to never attempt to restore an old view or never save a view (without modifying the code) so that every time I refresh the page during the design phase I can see the new changes right way?

Reply via email to