The moose likes JSF and the fly likes Using c:import with JSF deferred expression Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSF
Bookmark "Using c:import with JSF deferred expression" Watch "Using c:import with JSF deferred expression" New topic

Using c:import with JSF deferred expression

Ronan Dowd
Ranch Hand

Joined: Jan 21, 2006
Posts: 84
Hi All,

Having an issue with JSF (1.2) and JSTL (a c:import tag).
I know that JSP and JSF have differing lifecycles so using JSTL and JSF within the same JSP can yield unpredicatable results..

My JSP (fragment) contains the below (customerBean is a JSF managed, session-scope, bean):

<c:import url="${customerBean.name}"/>

On initial page load I get a exception as below

Error 500: org.apache.taglibs.standard.tag.common.core.NullAttributeException: The "url" attribute
illegally evaluated to "null" or "" in <import>

It looks like the evaluation of ${customerBean.name} is not occurring at the same time as that of the c:import, hence the url attribute being null or empty string
I tried changing it to use a deferred expression as below but no joy:

<c:import url="#{customerBean.name}"/>

Interestingly If I replace the c:import with the below it prints the correct value
<hutputText value="#{customerBean.name}"/>
so it's as if the value is known within the context of the JSF bean

I've tried using jsp include action and directive as below but no joy either

<%@include file="${customerBean.name}"/>
<jsp:include page="${customerBean.name}"/>

Any help would be great

Thanks, Ro

I agree. Here's the link: http://aspose.com/file-tools
subject: Using c:import with JSF deferred expression
Similar Threads
mockQuestion from javabeat
c:import with Facelets
Can not Populate the form on combo box change
Need help with JSTL: setting end attribute dynamically of "substring" tag
javax/servlet/jsp/tagext/JspIdConsumer exception in JSF Richfaces