• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to forward a response to JSP after recieving some data from an applet via URL connection

 
Pira Tomatsu
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The JFileChooserApplet sends selected files name to this Servlet via URL connection. And I want this Servlet to write selected files(pictures) name in <param> tags for another applet to display. Any advices for me?

I'm so new to servlet & JSP. Please clearly explain the solutions. Thanks a lot.

This code got this error: java.lang.IllegalStateException: Cannot forward. Response already committed.
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It doesn't make sense for the servlet to do a forward to some other JSP - the output would be accessible to the applet through the URLConnection, but it wouldn't be displayed anywhere. Instead, the servlet should store all pertinent data as session (or application) attributes, and then return to the applet an URL that can be used to access the display.jsp page, most likely including one or more URL parameters that tell the JSP what to do. The applet would then use the AppletContext's showDocument method to replace the page containing the applet with display.jsp. (It could also open a new window using the two-parameter showDocument method if you still want the applet to be visible.)
 
Pira Tomatsu
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please provide me some examples. I'm not clearly understand. Thank you very much
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic