|
Mailing Lists
|
Home /
Groups /
JRun-Talk
HTTP Request
Hi everyone,Amy Lounsbury 07/31/01 09:34 A Are you using a URL connection? Check out java.net.URL andDave Feltenberger 07/31/01 09:53 A Hi everyone, I am working on a web project where I need to I need to be able to make an HTTP request, grab the contents of one file (located on a separate port) and put them into a DHTML menu on the site. This will allow a list of the most active online discussions to appear in my menu at all times. I am having trouble grabbing the contents of the originial file and inserting it into the new file using JSP. Any ideas would be greatly appreciated! Amy --------------------------------- Velir Studios Amy Lounsbury amy@velir.com 617.945.2086 | 617.945.1896 fax ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Are you using a URL connection? Check out java.net.URL and java.net.HttpURLConnection. URL should work fine - I use it to grab a file off of a server in an applet I wrote. Here's a code snippet that should work: import java.net.*; URL myFlatFile = new URL ("http://www.myFlatFileSite.com:8080", "myFlatFile"); BufferedReader in = new BufferedReader ( new InputStreamReader (myFlatFile.openStream ())); String tmp = ""; while ((tmp = in.readLine ()) != null) { // do stuff with tmp - it's the flat file being // read in line by line.. } ----- Excess quoted text cut - see Original Post for more ----- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm
|
May 25, 2012
|
Latest Fusion Authority Articles
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||