The image URL is at least very strange.
Here,
for(int i=1;i<=25;i++) {
images.add("/resources/Tutorial"+i+".jpg");
}
you're specifying the full webcontent-relative URL.
And here,
<p:graphicImage value="/resources/Tutorial/#{image}" ... />
you're assuming the image URL to be relative to /resources/Tutorial
.
So, your image URL ends up to be like
/resources/Tutorial/resources/Tutorial1.jpg
Two times /resources
? This doesn't seem right. If you have paid attention to the HTTP traffic in the webbrowser's developer toolset (press F12 in Chrome/IE9/Firebug), then you should have noticed that the browser was receiving 404 Page Not Found erros on all those images. Also, if you have paid attention to the src
of the generated HTML <img>
elements, you should have noticed that something's not right.
Assuming that you've the Tutorial[n].jpg
images in the /resources/Tutorial
folder,
WebContent
|-- META-INF
|-- WEB-INF
|-- resources
| `-- Tutorial
| |-- Tutorial1.jpg
| |-- Tutorial2.jpg
| |-- Tutorial3.jpg
| : :
|
`-- page.xhtml
then you should be preparing the image file names as follows:
for(int i=1;i<=25;i++) {
images.add("Tutorial"+i+".jpg");
}
and be referencing them as follows (note: name
, not value
!)
<p:graphicImage name="Tutorial/#{image}" ... />
As to the PWC3999 exception, that concerns a completely different problem. How to solve it, look at Adding <h:form> causes java.lang.IllegalStateException: Cannot create a session after the response has been committed. In other words, just upgrade Mojarra.
As to the non-serializable attribute warning, just let the mentioned class implement Serializable
.