• Post Reply Bookmark Topic Watch Topic
  • New Topic

request by applet response to browser ?  RSS feed

 
Thomas Rochon
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi there !
I'm posting a request to a Webserver via an URLConnection, using an applet.
Now the Webserver responds by sending pure HTML back to the applet.
Question is:
Is there a way to redirect (or whatever) the server's response to the
browser in whitch the applet is running (or maybe in a new browser window)?
I would be very happy to hear from you.
- Thomas -
 
Maulin Vasavada
Ranch Hand
Posts: 1873
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Thomas
If you want to redirect the webserver's response to the browser then why would we need to make URLConnection from applet? Why just not popup a new window from the applet using showDocument() method like,
getAppletContext().showDocument(myURL,"_blank");
where myURL is the one you are making URLConnection to right now.
If you are posting any parameters via URLConnection then you would have to create an intermediate page say myURL1 which posts the parameters to myURL and use,
getAppletContext().showDocument(myURL1,"_blank"); instead....
Let us know what happens...
HTH
Maulin
 
Thomas Rochon
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Maulin,
thanx for your reply !
I tried to use getAppletContext().showDocument(myURL,"_blank"),
but it throws a NullPointerException.
Any idea why ?
 
Thomas Rochon
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Problem solved the way you told me, Maulin!
I had to fix some bugs in my code, first.
But after that it worked fine.
Thank you very much
- Thomas -
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!