This content has been marked as final. Show 1 reply
You are using a BEAN on one a single page without defining the scope of it. So by default the scope of bean is PAGE.
This means when the page is loaded, there is a bean initialized and same is available to that particular page.
Now in your bean, the method getFileName(), increases everytime the value of variable "index", and reading the name from list of that index.
Definitely everytime you refresh the page, the value of "index" will be increased and you will get the next image_file_name.
For better understanding, i will suggest to run the application in debug mode and put the dubug point inside your bean methods.