Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Problem in setting view root in beforeRenderResponse()  RSS feed

Dushyant Agarwal
Ranch Hand
Posts: 75
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am developing an application in which a JSF page - pageA.jsp, has a backing bean pageA.jsp has an <f:phaseListener > tag . implements PhaseListenerand has got the follwoing code in beforeRenderResponse() method :

public void beforePhase(PhaseEvent e){



public void beforeRenderResponse(){
( FacesContext.getCurrentInstance().getExternalContext().getSession(true)

The "savedViewOfPageB" label is mapped to the UIViewRoot instance of another JSF page - pageB.jsp. And it is saved in an action method called in pageB's Backing Bean, when a command button is clicked in pageB.jsp. As well as there is navigation from pageB to pageA.

So now there Navigation pageB==>pageA & the view root of pageB is saved on session which has got to be displayed as soon as the rendering of pageA takes place.

But the view root of pageA does not get changed(to that of pageB) on initial request. If I make a postback on pageA then the new view(that of pageB) gets rendered. How can I change the view root of pageA to that of pageB in beforeRenderResponse
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!