[EMAIL PROTECTED] wrote:
In some cases, I want to dynamically import fragment of page. Such as:
<c:import url="#{masterBean.action}" />
I used <h:outputText value="#{masterBean.action}"/> to test
masterBean.action returns correct value, for instance, main.jsp.
But it seem it could not be imported in this way, I was told:
The requested resource (/myproject-name/#{masterBean.action}) is not
available.
Could anyone give me any clue how to deal with this? Or an alternate
solution.
When using jsp1.1:
* the #{..} syntax is only processed within an attribute of a JSF tag.
* the ${..} syntax is not permitted within an attribute of a JSF tag
You can probably change to using:
<c:import url="${masterBean.action}"/>
The only difference is that the masterBean object must already exist, as
the JSP ${...} stuff won't create a bean from the JSF "managed beans"
definitions in the faces config file. As long as there is a reference to
#{masterBean} somewhere earlier in the same page the bean will exist so
that should be ok.
Note by the way that JSTL tags generally don't work well with JSF1.1. In
particular, c:forEach and c:if are a bad idea. However I *think*
c:import would be ok as it doesn't have any conditional behaviour.
Regards,
Simon