Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Applet to JSP and use of ShowDocument

 
Sharang Thorat
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
i am trying to send data from Applet to Jsp
my requirement is i am sending some data to JSP from
applet. The jsp is processing some data and creating
a form for user.
Now the same jsp with data already sent should be displayed when
i call ShowDocument from Applet.
try
{
/* This vector is assumed to be list of the object ids and object class
currently only object classes are assumed
*/
Properties prop = WTProperties.getLocalProperties();
String urlname = prop.getProperty("wt.server.codebase");
urlname = urlname.concat("/rs/jsp/jsp/RSChecks.jsp");
String param1 = "param1=component¶m2=connection";
URL url = new URL(urlname);
HttpURLConnection con = (HttpURLConnection)url.openConnection();
con.setDoInput(true);
con.setDoOutput(true);
con.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
con.setRequestProperty("Content-length",""+ param1.length());
con.connect();
PrintWriter pw = new PrintWriter(con.getOutputStream());
pw.println(param1);
pw.close();
// con.getContent();

java.applet.Applet applet = wt.util.WTContext.getContext().getApplet();
AppletContext context = applet.getAppletContext();
context.showDocument(url,"_blank");

} catch(MalformedURLException exc)
{
exc.printStackTrace();
System.out.println("URL wrong !!!\n");
}catch (Exception eio)
{
eio.printStackTrace();
}
How to Do it. Its ok while sending data to JSP but how to
view same data in jsp after doing the ShowDocument in Applet
Help is needed
Sharang
 
What are you doing? You are supposed to be reading this tiny ad!
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!