WebSphere Portal Server - How to reset jsf view to initial state

This is Interesting: Free IT Magazines  
Home > Archive > WebSphere Portal Server > June 2007 > How to reset jsf view to initial state





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author How to reset jsf view to initial state

2007-06-20, 1:28 pm

Hello,

I have a jsf portlet and facing a small problem.
I have 3 views for my functionality. When I am on 3rd view, there is a button that takes me outside of jsf navigation to some other portal page.
I do it with this snippet:

facesContext.getExternalContext().redirect("<url to some portal page>");



Problem is, when some other navigation flow brings same user to my jsf portlet, it goes directly to 3rd view, skipping first 2 views.
To resolve this, I have following snippet in doView() of my jsf portlet. I use this conditionally of course.

FacesContext ctx = getFacesCTX(request, response);
UIViewRoot newView = ctx
.getApplication()
.getViewHandler()
.createView(ctx,
"/initialView.jsp");
ctx.setViewRoot(newView);


Question is can I get rid of this logic? Is there any better way of doing it?

Thanks,
bchinc
Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com