I have two servlets, test1 and test2.
test1 writes a line and calls test2 with the RequestDispatcher.include()
on return from test2 test1 writes a last line.
This should result in:
before:
test2 test2
after:
but I get:
before:
after:
Why?
I am using JRun 2.3.1 build 145 with servlet API 2.1 and jsp 0.92.
test1:
=====
public void doPost(HttpServletRequest request, HttpServletResponse response) {
String uri = "/servlets/test2";
RequestDispatcher dis = null;
PrintWriter out = null;
response.setContentType("text/html");
dis = getServletContext().getRequestDispatcher(uri);
try {
out = response.getWriter();
} catch (Exception e) {}
out.println("before:<br>");
try {
dis.include(request, response);
}
catch ( ServletException e1) {}
catch ( IOException e2) {}
out.println("after:<br>");
}
test2
=====
public void doPost(HttpServletRequest request, HttpServletResponse response) {
PrintWriter out = null;
try {
out = response.getWriter();
out.println("test2 test2<br>");
} catch (Exception e) { }
}
}
/Magnus
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
FAQs on JSP can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html