• Post Reply Bookmark Topic Watch Topic
  • New Topic

FacesContext rendering  RSS feed

 
Davie Lin
Ranch Hand
Posts: 294
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

I have a question about this code



I inherited this JSF app from a previous employee. as of now, this 2 line of codes are commented out
and the page still work just fine. These codes are placed at the very end of the method. This lead me to believe the JSF framework (under normal circumstance) render the response for me without the code above. My question here is, is my conclusion above correct and under what circumstances would I need to use



Thanks for all your input.
 
Donald Jackson
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It depends on what phase of the application lifecycle the method in question is being called in. The commented out code simply sends control directly to the Render Response phase, skipping any of the other potential phases that may be between where the flow of control presently is and it's inevitable destination.

Think: Restore View -> Apply Request Values -> Process Validations -> Update Model -> Invoke Application -> Render Response

It depends a great deal on what the code leading up to the commented out lines was doing.

Mark
 
Davie Lin
Ranch Hand
Posts: 294
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey Donald

Thanks for your reply, the code proceeds my commented out code are like



the type of the above objects are



I believe the code proceed the commented out code was already in the "Render Response" phase
so that's probably why there was no difference weather



was commented out or not.

Does that sound right to anyone?

Also, can anyone give me suggestion is that's a good practice or not. I was thinking of encapsulating these HTML object into another POJO and have my backing bean contain a reference. Appreciate all your thoughts

 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!