• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Using c:import with JSF deferred expression

 
Ronan Dowd
Ranch Hand
Posts: 84
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic