Try to use one of listed below methods:
1. Insert code to JSP
<% response.reset();
response.sendError(SC_NOT_MODIFIED);
%>
2. Write any tag implementation as
class TestMidifiedTag extends TagSupport {
...
public int doStartTag() throws JspException {
HttpServletResponse resp = (HttpServletResponse)pageContext.getResponse();
if(<place any code for testing last modified here>) {
resp.reset();
resp.sendError(SC_NOT_MODIFIED);
}
return SKIP_BODY
}
...
}
and use it in JSP as
<util:modified/>
with all needed actions for tag library registration and tag definitions
for it.
SM> In the HTTPServlet world, the servlet container gives my servlet the
SM> chance build a response based around the '304 Not Modified' message,
SM> via a long valued integer specifying a last modified time
SM> (getLastModified()). Great stuff, invaluable for servlets which
SM> format some data once and then serve it forever.
SM> Hmm, now I'm into JSP, if I have a JSP page with static HTML and a
SM> single <jsp:include> of a servlet, there seems no way for the JSP page
SM> implementation class to handle this notion of lastModified().
SM> Hmm, the HttpJspPage doesn't even extend HttpServlet so I guess this
SM> functionality isn't planned?
SM> I have perused the JSP 1.1 spec, nothing.
SM> I'm tempted to wrap all my JSP pages inside servlets, using
SM> requestDispatcher.includes()s, so I'll get the 304 options back...
--
Best regards,
Oleg mailto:[EMAIL PROTECTED]
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html
http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets