Bookmark Topic Watch Topic
  • New Topic

calling servlet from java program

 
Amit Dubey Kumar
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Report post to moderator
actuly i m using
FileOutputStream fos = new FileOutputStream("t.tmp");
ObjectOutputStream oos = new ObjectOutputStream(fos);
oos.writeObject(aa);
System.out.println("writeobject" +oos);
oos.close();
FileInputStream fis=new FileInputStream("t.tmp");
ObjectInputStream resultStream = new ObjectInputStream(fis);
ArrayList as=(ArrayList)resultStream.readObject();
System.out.println("Array"+ as);


in my servlet and i m calling this servlet from java program but i dont want to carete any FileInputStream fis=new FileInputStream("t.tmp");
and i want to cann servlet from java program
give me reaply if anybody know abt dis
thnx in advance
 
ravi smart
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Report post to moderator
To call Servlets from Java Program use
URL testServlet = new URL( location );
URLConnection servletConnection = testServlet.openConnection();

This is the best way to implement from java program

Try this
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65524
105
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Report post to moderator
Please do not post the same question more than once.
 
    Bookmark Topic Watch Topic
  • New Topic
Boost this thread!