[jboss-user] [Tomcat, HTTPD, Servlets & JSP] - Cookies lost when included JSP file used

weisinger do-not-reply at jboss.com
Wed Jul 11 17:55:19 EDT 2007


The following file creates a cookie when called alone, but when this file is included in another JSP, the cookie doesn't survive.
Is this a bug in the JBoss App server, or is there configuration or code that I can use to get it to work?

cookietest.jsp
<%@ page contentType="text/html" %>
  | <html><body>
  | <p>
  | <jsp:directive.page import="javax.servlet.http.Cookie"/>
  | <jsp:scriptlet><![CDATA[
  |    Cookie c = new Cookie("NewCookie","Data for Cooki");
  |    out.println(c.getName()+": "+c.getValue()+"<br/>");
  |    response.addCookie(c);
  | ]]></jsp:scriptlet>
  | </p>
  | </body></html>

It fails though when included in this JSP page:

jsptest.jsp
<%@ page contentType="text/html" %>
  | <jsp:include page="./cookietest.jsp" flush="true"/>
  | <html><body>
  | <center><b>JSP Test</b></center>
  | </body></html>

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4063243#4063243

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4063243



More information about the jboss-user mailing list