Indeed, but it does make me wonder if people want to be coding in Java
doesn't it rather defeat the point in using CFML?
CF has always had the ability to call java servlets, java cfx tags or jsp
pages, does OpenBD also have these abilities too ?

Russ

-----Original Message-----
From: Alan Williamson [mailto:[email protected]] 
Sent: 26 November 2009 20:01
To: [email protected]
Subject: Re: [OpenBD] Server Side Javascript via CFJS

Allen,  with <CFJS> you can reach into Java much easier now.

Consider the following code snippet that pulls down the Google home page.

<cfjs>
var con = new java.net.URL("http://www.google.com/";).openConnection();
var stream = new java.io.InputStreamReader(con.getInputStream());
var buffer = new java.io.BufferedReader(stream);
var line;

var responseText = "";
while ( (line = buffer.readLine()) != null)
   responseText += line;

stream.close();

$cf.print( responseText );
</cfjs>



Much quicker than messing around with CreateObject("java",...) and what 
have you.


G Allen R Souliere wrote:
> Am I am reading this correctly in that it would be possible to actually
> write full-on java code (with class definitions, main methods, etc....)
> within<cfscipt>  tags?  I would be very excited about this.


-- 
aw2.0
   http://www.aw20.co.uk/

-- 
Open BlueDragon Public Mailing List
 http://www.openbluedragon.org/   http://twitter.com/OpenBlueDragon
 mailing list - http://groups.google.com/group/openbd?hl=en

 !! save a network - please trim replies before posting !!


-- 
Open BlueDragon Public Mailing List
 http://www.openbluedragon.org/   http://twitter.com/OpenBlueDragon
 mailing list - http://groups.google.com/group/openbd?hl=en

 !! save a network - please trim replies before posting !!

Reply via email to