I'm having some trouble getting the c:import tag to work right.
It seems to be perfectly fine when the request that tomcat receives is
a GET request.  However, when it receives a HEAD request instead, c:import
never actually reads the data.
        Is this a known bug?  Is it fixed in a more recent version of tomcat?
I'm using 5.0.30.

eric

Here's an example jsp file testit.jsp:
---cut---
<%@ taglib uri="http://java.sun.com/jsp/jstl/core"; prefix="c" %>
<c:import url="/testit.txt" var="foo"/>
<%
    System.out.println("FOO:[" + pageContext.getAttribute("foo") + "]");
%>
worked: ${foo}
---cut---

Here's testit.txt:
---cut---
data data data
---cut---

When I send a GET request to retrieve /myapp/testit.jsp, I get the expected
"worked: data data data" in the response, and in catalina.out I get:
---cut---
FOO:[data data data
]
---cut---
That's what I expect.  However, if I send a HEAD request I get no output
other than headers in the response (as I expect), but catalina.out has
this instead:
---cut---
FOO:[]
---cut---
Notice there's nothing inside the [].

Here's my HEAD request transcript:

poe: {50} telnet localhost 8080
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
HEAD /myapp/testit.jsp HTTP/1.1
Host: localhost:8080

HTTP/1.1 200 OK
Set-Cookie: JSESSIONID=5A2DA89DDC03A24F4CF110EFD1BB6541; Path=/myapp
Content-Type: text/html;charset=ISO-8859-1
Content-Length: 15
Date: Sun, 18 Dec 2005 05:29:54 GMT
Server: Apache-Coyote/1.1

^]
telnet> c


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to