This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes can i get other website contents in my webapplication Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Beginning Java
Reply Bookmark "can i get other website contents in my webapplication" Watch "can i get other website contents in my webapplication" New topic
Author

can i get other website contents in my webapplication

subba rao
Greenhorn

Joined: Apr 24, 2008
Posts: 24
we have a web application .In that search by flight number option is there.If i enter flight number ,it has go to the below url and whatever contents are displaying there those contents i want to display it here in my application.for this one i am using URLConnection class.by using this class i will get only contents of the view source code.how to proceed further to accomplish this task?

are there any other options other than this?
import java.net.*;
import java.io.*;

class ConnectionTest {
public static void main(String[] args) {
try {
URL travel = new URL("http://travel.travelocity.com/flifo/FlifoRequest.do");
URLConnection travelConnection = travel.openConnection();
DataInputStream dis = new DataInputStream(travelConnection.getInputStream());
String inputLine;

while ((inputLine = dis.readLine()) != null) {
System.out.println(inputLine);
}
dis.close();
} catch (MalformedURLException me) {
System.out.println("MalformedURLException: " + me);
} catch (IOException ioe) {
System.out.println("IOException: " + ioe);
}
}
}
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 35241
    
    7
If all you want to do is display the contents of the URL, the easiest would be to load it in an IFRAME that's embedded in the web page. That way, the browser gets to do all the work of loading the page.


Android appsImageJ pluginsJava web charts
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: can i get other website contents in my webapplication
 
Similar Threads
Please Help -Problem in Regular Expressions
Finding the largest table ina web page and displaying it
about URL access (Please help me
Holy SPANK!! I got a connection...
Write bufferedreader to a file