You are viewing a plain text version of this content. The canonical link for it is here.
Posted to taglibs-user@tomcat.apache.org by Stephen Letschin <st...@media.umbc.edu> on 2003/10/23 22:51:14 UTC

Problem with c:import (JSTL 1.0)

I am having a problem with a c:import that I hope someone has an answer to.

I have a JSP that is build out of several pieces (via a Struts Tiles
definition). As a result, I have developed some code which tracks the last
modified date of each piece and compares it against those I have seen so
far as the page is being built so that I can display the correct date in
the page's footer area. That code is below. It works fine in most cases.
However, I have one section of the page which I call header-extras which
is where I link in the CSS and JS files I need for that page as a part of
the page's header information. The header-extras file structure is
basically:
   <c:import url="the default header-extras file.jsp" />
   <style type="text/css">
   <!--
        <c:import url="page's specific CSS file.css.jsp" />
   -->
   <script language="javascript">
   <!--
        <c:import url="page's specific JS file.js.jsp" />
   //-->
   </script>

That structure has been working fine and I have the CSS and JS files as
actually JSPs which have as their output CSS and JS so I can store
comments and I was hoping so that I could include the last-modified date
code in them. Everything works fine until I add the last-modified date
code to any of the "CSS" or "JS" files. As soon as I do that, the page
loads the "CSS" or "JS" file with the date code in it and then ignores the
rest of the imports in the header-extras file. Anyone have any idea what I
am doing wrong? I am not getting any error messages that I could use for
debugging.
The date-modified code is:

<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jstl/fmt" prefix="fmt" %>

<fmt:setLocale value="en-US" />
<fmt:setBundle basename="resources.application" />
<fmt:parseDate
    var="lastModDate"
    value="10/23/2003"
    pattern="MM/dd/yyyy"
    scope="request" />
<c:if test="${empty lastModifiedDate || lastModDate > lastModifiedDate}"
    <c:set var="lastModifiedDate" value="${lastModDate}" scope="request" />
</c:if>

Thanks.

Stephen Letschin
stephen@media.umbc.edu




---------------------------------------------------------------------
To unsubscribe, e-mail: taglibs-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: taglibs-user-help@jakarta.apache.org