1

I currently have a JSP page that displays data when I press my command button below by going to my Java page to display this data. I cannot for the life of me figure out how to change this to an onLoad event or something that will display the data every time the page is refreshed.

<h:commandButton styleClass="buttonLarge" value="Search" action="#{SearchHandler.Search}" />

Thanks for your help!

1 Answers1

0

Create backing bean and bind fields to it. Then you will get information from server every time page is rendered.It must be session scoped bean in order to keep it's state among requests. Otherwise values in fields will get refreshed.

You can initialize bean state in init method.

http://docs.oracle.com/javaee/5/tutorial/doc/bnaqm.html

Kasper Ziemianek
  • 1,329
  • 8
  • 15