0

I am new to JSF and need help with the following.

I have a scenario where I receive a response from a thrid party website in a ResponseServlet. In the ResponseServlet, I call a 'CCBean' method to do some processing using the POST parameters appended to the ResponseServlet by the 3rd party website. I have some new result after an API call in this 'CCbean' method.

I need to display this result and some of the POST parameters in the jsf page which displays the properties of the CCBean. The problem I have is whenever the jsf page is loaded for the first time, it displays blank values.If I attempt the transaction again - it displays all the values. I am not initializing the bean in the jsf page, if I do the result value from the API is null. I am simply doing

How do I get the CCBean properties to display correctly on the first load of the jsf page. Please suggest.

My Code:

String paySuccess = CCBean.makePayment();
if(paySuccess.equalsIgnoreCase("X")) {
    request.getRequestDispatcher("/pages/hpp_success.xhtml").forward(request, response);
} else {
    request.getRequestDispatcher("/pages/failed.xhtml").forward(request, response);
}
Christian Gollhardt
  • 15,685
  • 16
  • 74
  • 107
  • Some code would help to answer us. – Christian Gollhardt Jun 07 '14 at 01:59
  • following is the code in ResponseServlet.java in the doPost method. String paySuccess = CCBean.makePayment(); if(paySuccess.equalsIgnoreCase("X")) request.getRequestDispatcher("/pages/hpp_success.xhtml").forward(request, response); else request.getRequestDispatcher("/pages/failed.xhtml").forward(request, response); hpp_success is my jsf page and CCBean is the backing bean for the jsf. – user3716891 Jun 07 '14 at 02:19
  • In CCBean, I have a loadparameters method which reads the post parameters from the URL , and makePayment does some processing using the above parameters. I need to display the POST parameters as well as some result properties from makePayment method in the jsf page. The jsf page is blank on the first load but works fine on successive transactions. – user3716891 Jun 07 '14 at 02:19
  • I have edited your question, hope it is ok. And welcome to SO. – Christian Gollhardt Jun 07 '14 at 02:26
  • resolved by referring to this link http://ocpsoft.org/opensource/how-to-safely-add-modify-servlet-request-parameter-values/ – user3716891 Jun 10 '14 at 01:55

0 Answers0