The Artima Developer Community
Sponsored Link

Legacy Java Answers Forum
June 2000

Advertisement

Advertisement

This page contains an archived post to the Java Answers Forum made prior to February 25, 2002. If you wish to participate in discussions, please visit the new Artima Forums.

Message:

Reply

Posted by Shreyas on December 18, 2000 at 7:27 PM

> Hello All

> I am writing this mail after I have exhausted all my resources to solve the below problem. I would really appreciate any help from you.

> I have an applet which is talking to a servlet. The applet has following piece of code

> servletConnection.setDoInput(true);
> servletConnection.setDoOutput(true);

> Then there is a method called
> readServletResponse(servletConnection); which reads the response from the
> servlet.

> If I comment out the the call to this method the communication does not take place So I have to call this method. Why is this? What if I do not want to get the response from the servlet

> However my original problem is that after I send the data(userid and password) to the servlet the servlet authenticates the user and dynamically generates a new HTML page and writes it to the o/p stream. I was expecting the HTML page to be displayed. In normal circumstances the data is sent to the browser which knows how to parse this data.

> But in my case this o/p stream is connected to the applet therefore the
> applet receives this data and does not know what to do with it.

> I cannot generate an HTML page on the servlet which I can load from the applet because anybody can bookmark the page and bypass the authenticaton process next time.

> In short in applet-servlet scenario how do I load a new HTML page on the users browser?

> Thanks a lot for your time

> Nitin

Make

servletConnection.setDoOutput(false);

if you donot require response from servlet





Replies:
  • Reply Shreyas December 18, 2000 at 7:29 PM (0)

Sponsored Links



Google
  Web Artima.com   
Copyright © 1996-2009 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use - Advertise with Us