jsf page displays blank values on first load

风流意气都作罢 提交于 2019-12-12 02:49:50

问题


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);
}

来源:https://stackoverflow.com/questions/24092812/jsf-page-displays-blank-values-on-first-load

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!