• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Ron McLeod
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

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

 
Ranch Hand
Posts: 115
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi steve,
can you share some example code with me about what u said in ur reply..
regards
karan
 
Ranch Hand
Posts: 113
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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)
{
}
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic