Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Disaply the HTML generated by Servlet.

0 views
Skip to first unread message

Jason

unread,
Jul 30, 2001, 11:12:22 AM7/30/01
to
What I want to do is to show the HTML file generated by my Servlet.
First, my Applet calls the Servlet by POST transferring some parameters -
succeeded!
Then, the Servlet generates an HTML file by :

response.setContentType("text/html");
pw=response.getWriter();
pw.println("<html><body>");
.. ..
pw.println("</body></html>");

However, I just could not have the newly generated HTML displayed.
In my Applet, I tried to use "showDocument(url, "_blank")" to display it,
where "url" is the same URL used to successfully transfer the parameters
from Applet to Servlet. While, I got an exception:
---------------------------------------------------------------------------
HANDLER THREAD PROBLEM: java.io.IOException: Socket Closed
java.io.IOException: Socket Closed
at java.net.PlainSocketImpl.getInputStream(Unknown Source)
at java.net.Socket$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.Socket.getInputStream(Unknown Source)
at
com.sun.web.server.ConnectionHandler.run(ConnectionHandler.java:161)
----------------------------------------------------------------------------
---------
Then the new IE browser told me that the file is not available.

Any suggestions?

Thanks!

Jason


Jason

unread,
Jul 30, 2001, 12:49:12 PM7/30/01
to
I figured out that the showDocument() actually call the doGet(). Therefore,
I put the all the response commands under doGet() and call doGet() at the
end of doPost(). It works.
Originally, since I just pass some objects from Applet to Servlet in
doPost(), I didn't code the doGet(). Therefore, no response to
showDocument() call.

Thanks!


"Jason" <jz...@dental.temple.edu> wrote in message
news:9k3te6$fni$1...@cronkite.temple.edu...

0 new messages