You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Garret Wilson <ga...@globalmentor.com> on 2004/09/18 07:34:57 UTC
jstl:import---static information?
According to the JSF and JSTL documentation (and two JSF books),
<jstl:import> should dynamically import information. I have:
<jsf:view>
...
<jsf:subview id="navigation">
<jstl:import url="navigation.jsp"/>
</jsf:subview>
...
</jsf:view>
However, everything from navigation.jsp is included
literally---including all JSF tags and everything in the imported JSP.
This happens both on Tomcat 5.5.2 and 5.0.28, so I must be doing
something wrong---yet I'm using examples almost verbatim (pun not
intended) from _Core JavaServer Faces_ and _Mastering JavaServer Faces_.
Shouldn't the imported information be merged into the JSF component
tree, rather than just spitting out the JSF tags (and all other tags) as
if they were serialized literally?
Garret
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
Re: jstl:import---static information?
Posted by Garret Wilson <ga...@globalmentor.com>.
Garret Wilson wrote:
> Shouldn't the imported information be merged into the JSF component
> tree, rather than just spitting out the JSF tags (and all other tags) as
> if they were serialized literally?
I've discovered several things. First, it appears you must have
something like this in your included file:
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="jsf" %>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="html" %>
Using standards-compliant JavaServer Faces-compatible stuff like
defining namespaces doesn't seem to work:
<jsf:verbatim
xmlns:jstl="http://java.sun.com/jstl/core"
xmlns:jsp="http://java.sun.com/JSP/Page"
xmlns:jsf="http://java.sun.com/jsf/core"
xmlns:html="http://java.sun.com/jsf/html">
With the <%@ taglib>s, the information is correctly processed and folded
into the component tree instead of being included statically.
Secondly, don't create an entire HTML file in the included file. Even
though _Professional JavaServer Faces_ (page 189) shows an entire HTML
file in an included file, doing so will cause those elements to be
included in the original file---resulting in a duplicate <html> inside
<body> and the like.
(Sorry if this should have went to a JavaServer Faces list---I didn't
know if this was a Tomcat bug at first.)
Garret
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org