0

We are using MyFaces 1.1.1 My question is - Is it possible to skip the browser ( discard the rendered jsp) during renderResponse in jsf lifecycle and instead send an HttpRequest to simulate user clicking a button in the jsp at times(say based on some 'skip' variable) ?

I am trying to see how if jsf lifecycle can somehow be changed to abandon rendering of the current page and instead simulate the click of a button on the current page.

  • Strange, unusual, uncommon question. What is the actual use case? – Kukeltje Oct 05 '18 at 06:10
  • we are processing many records and when the processed record has no errors , the user should not be sent the rendered jsp. –  Oct 08 '18 at 15:20
  • Then send to a different page then.... – Kukeltje Oct 08 '18 at 15:32
  • The requirement is I dont want to show any other page, instead I want to have like a "bypass" feature in myfaces to discard the httpresponse. –  Oct 09 '18 at 00:16
  • Then, conditionally, return null or void in the action and you stay on the same page. – Kukeltje Oct 09 '18 at 05:14
  • Just to experiment, where should I try to bypass the browser ( renderResponse) , discard the Httpresponse? Any ideas on this? –  Oct 09 '18 at 20:05
  • You don't/should not try to bypass anything, like I stated before... You make sure the browser gets the right response by explicitly sending it the right response from the managed bean. See https://stackoverflow.com/questions/2777852/navigate-to-the-same-page-after-action-in-jsf-2 and https://stackoverflow.com/questions/17631949/how-can-i-navigate-to-another-page-in-managed-bean but maybe learn about ajax too since that seems more suitable here – Kukeltje Oct 10 '18 at 08:58
  • Thanks. Just read - Use FacesContext#responseComplete() to signal JSF that you've already handled the response yourself and that JSF thus doesn't need to render the response. Will this help in my case ? –  Oct 11 '18 at 01:30
  • If you are going to manually send a pdf or textfile or excel then yes, but that does seem to be your usecase – Kukeltje Oct 11 '18 at 07:15

0 Answers0