In the file aPage.xhtml, I have the following lines:
<ui:include rendered="#{not empty param.target}" src="#{param.target}.html" />
<ui:include rendered="#{empty param.target}" src="About.html" />
With the lines above, I expected that when I go to http://localhost:8080/beta/aPage.xhtml, the page About.htmlwill be included because param.target- null. However, GlassFish threw me the following exception:
java.io.FileNotFoundException: http:
Somehow, param.targetit was not considered null.
In addition, I tried using operators ==and !=as follows:
<ui:include rendered="#{param.target != null}" src="#{param.target}.html" />
<ui:include rendered="#{param.target == null}" src="About.html" />
Interestingly, this time, on the GlassFish console, I did not see any exceptions. However, in the browser, the error page still appears with an exception java.io.FileNotFoundException.
I would be very grateful if you could tell me why this happened and what I have to do to avoid this.
UPDATE:
Joop Eggen , , :
<ui:param name="noTarget" value="About.html" />
<ui:param name="hasTarget" value="#{param.target}.html" />
<ui:include src="#{empty param.target? noTarget : hasTarget}" />