• Post Reply Bookmark Topic Watch Topic
  • New Topic

Is there any way to make the browser invisible yet sending a request

 
Vineela Vishnubhatla
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi ,
I am developing an intranet application,In which on each client machine startup i want to open a browser and send a request to the servlet through a batch file.

My requirement is that "I should make the browser invisible to the client"

Thanks in advance
 
ganesh pol
Ranch Hand
Posts: 151
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
just check following



import java.net.URL;
import java.net.URLConnection;
import java.net.HttpURLConnection;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.FileOutputStream;

import java.util.Properties;

public class URLs {
public URLs () {
}

public static void main (String args[]) {
try {

String url = "http://www.yahoo.com/",
proxy = "172.16.1.2",
port = "3128";
URL server = new URL(url);
Properties systemProperties = System.getProperties();
systemProperties.setProperty("http.proxyHost",proxy);
systemProperties.setProperty("http.proxyPort",port);
HttpURLConnection connection = (HttpURLConnection)server.openConnection();

// Read all the text returned by the server
BufferedReader in = new BufferedReader(new InputStreamReader(server.openStream()));
FileOutputStream fo = new FileOutputStream("Website.html");
int len;
while ((len = in.read()) != -1) {
fo.write(len);
}
in.close();
fo.flush();
fo.close();

}
catch (Exception e) {
System.out.println(" _________________________________________ ");
System.out.println(" _______________ERROR: ___________________ ");
e.printStackTrace();
System.out.println(" __________________________________________ ");
}
}
}
bold faced code is required if your request goes through proxy server

[ UD: replaced link to copyrighted material with a harmless URL ]
[ August 03, 2007: Message edited by: Ulf Dittmer ]
 
Ram RR
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Ganesh,
The main requirement is that
Client system should not have JAVA.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!