• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

servlet to applet communication................

 
karan, chopra
Ranch Hand
Posts: 115
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi all,
how can i pass more than one array from a servlet to an applet?please reply ASAP,its urgent..........
thanks
karan
 
Steve Campbell
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can create an object containg more than 1 array and pass that way.
 
karan, chopra
Ranch Hand
Posts: 115
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi steve,
can you share some example code with me about what u said in ur reply..
regards
karan
 
Dorj Galaa
Ranch Hand
Posts: 113
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
String ConnectionURL="http://localhost:8080/servlet/yourServlet";
try
{
URL url = new URL(ConnectionURL);
URLConnection urlconnection = url.openConnection();
urlconnection.setDoOutput(true);
urlconnection.setUseCaches(false);
//BufferedWriter out2=new BufferedWriter(new OutputStreamWriter(urlconnection.getOutputStream()));
//PrintWriter out2=new PrintWriter(urlconnection.getOutputStream());
//out2.println(TelephoneNumber.getText());
//out2.println(MessageText.getText());
//out2.write(a1,0,a1.length());out2.newLine();
//out2.write(a2,0,a2.length());out2.newLine();
//out2.flush();
DataOutputStream out = new DataOutputStream urlconnection.getOutputStream());
out.writeChars(a1);
out.writeChars(a2);
out.flush();
if (out!=null)
out.writeByte(78);
out.close();
//out2.close();
}
catch(MalformedURLException e)
{
}
catch(IOException e)
{
}
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic