Split JSP tag across <%@include files
843840Aug 15 2010 — edited Aug 16 2010Hi,
I have an application that I am trying to port to a new server. The JSP pages in this application use the JSP include directive to include a standard header fragment. The header fragment opens a JSP tag (not just an HTML tag) but leaves it to the main page to close.
The actual code is using JSF tags, but for the purposes of simplification I'll illustrate with a standard JSP action.
header.jsp contains:
<jsp:useBean id="test" class="java.util.Date" >
home.jsp contains:
<%@ include file="header.jsp" %>
</jsp:useBean>
Current milliseconds = <jsp:getProperty name="test" property="time" />
My understanding is that this style of include is like a literal insertion of the contents, and so I would expect this to work (regardless of whether it is good style or not). However the server throws a compile error, saying that header.jsp contains an unterminated useBean tag.
So two questions: Is this in fact valid code that should work? And if not, is there a valid way to do something equivalent?
Many thanks,
Nick
Edited by: Nick_Newman on Aug 15, 2010 12:23 PM - improve formatting (I hope)