Hello all -
Hopefully this is a simple problem, but if i've missed out any information
i'll appreciate that it may not have a simple answer :
i am using the ibm websphere products - websphere studio and visual age for
java.
i am trying different ways of communicating between a servlet and a jsp.
The servlet extends httpservlet.
one simple servlet -> jsp movement is done using response.sendRedirect
("/url.jsp")
i am trying to use request dispatching to give me some more power in the
communication between the servlet and jsp and the way they present their
information.
my servlet has a printwriter set to output to the browser. my jsp runs a
scriptlet that does more or less the same thing, so i expect the same
action to happen twice (specifically, i am sending a mail via domino to a
domino server, creating a domino session using IIOP)
res.setContentType("text/html");
PrintWriter out = res.getWriter();
including a jsp into the servlet's output to the browser is as follows:
RequestDispatcher rd = this.getServletContext().getRequestDispatcher
("/approveTaskResults.jsp");
rd.include(req, res);
this works. i get the action being performed and output twice - once by
the servlet and once by the jsp. no errors. the domino mail box receives
the two mails.
if, however, i wanted to forward the request to the jsp:
rd.forward(req, res);
the two mails are still sent - which means the jsp was processed, but the
browser doesn't respond with any ouput apart from a page not found error.
why does it not respond with output?
I'm presenting this to you just in case there's something simple i've
missed or if there are any alternative ideas. One alternative is implement
a StudioPervasiveServlet - the kind that is generated by Websphere Studio's
wizards. this has a callPage method that interacts with a .servlet xml
file. Again, this technique sends the two mails, but responds with a page
not found error.
Thanks to all for reading this - hope it wasn't too wordy :-)
Indy.
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
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