File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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
Author

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


SCJP 1.4 | OCWCD JEE 5
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Using c:import with JSF deferred expression