Hi ppl, Kindly tell me some way, by which i can send a servlet request to web server from javaapplet, i mean, by just clicking any button from client applet, i want to send servlet or jsp request to the web server which will send some JSP or servlet page which will open a new web browser and display the contents of the jsp . Can we do this or not ??? if yes then tell me some hints or guide lines thanx Kindly reply me fast as it is an urgent for me . best regards khurram fakhar
posted 16 years ago
Hello Khurram, yes you can call a servlet from your applet by opening a connection to your servlet. The code below will help you to do this: URL url = new URL("URL of your servlet"); URLConnection con = url.openConnection(); in = new DataInputStream(con.getInputStream()); String readData = in.readLine(); Now the readDate string will contain the output from your servlet. This will be the output which the servlet will write to its output stream.
Hope this will solve your problem. Ask if u need more help. Asif Masood
Oh the stink of it! Smell my tiny ad!
the new thread boost feature: great for the advertiser and smooth for the coderanch user