Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to reset jsf view to initial state

843844Jun 19 2007 — edited Jun 21 2007
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
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 18 2007
Added on Jun 19 2007
1 comment
361 views