House of Fusion
Search over 2,500 ColdFusion resources here
  
Home of the ColdFusion Community

Mailing Lists
Home /  Groups /  JRun-Talk

HTTP Request

  << Previous Post |  RSS |  Sort Oldest First |  Sort Latest First |  Subscribe to this Group Next >> 
Hi everyone,
Amy Lounsbury
07/31/01 09:34 A
Top  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Amy Lounsbury
07/31/2001 09:34 AM

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

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Dave Feltenberger
07/31/2001 09:53 AM

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


<< Previous Thread Today's Threads Next Thread >>

Search jrun-talk

May 25, 2012

<<   <   Today   >   >>
Su Mo Tu We Th Fr Sa
     1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 31     

Designer, Developer and mobile workflow conference