jQuery in Action, 2nd edition*
The moose likes Java in General and the fly likes How to Redirect Java Command Prompt output to a Browser dynamically? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "How to Redirect Java Command Prompt output to a Browser dynamically?" Watch "How to Redirect Java Command Prompt output to a Browser dynamically?" New topic
Author

How to Redirect Java Command Prompt output to a Browser dynamically?

jasdev lamba
Greenhorn

Joined: Jul 04, 2001
Posts: 6
I want to redirect Command Prompt output from java program to a Browser dynamically.
1. I have written the output to a File using FileOutputStream
2. Now using Runtime class, I want to invoke that .html file
dynamically.
3. I am using exec() method, but its not working .
Please suggest the syntax for writing command line string inside the exec() method
or, some other way to do conversion function...
Ragesh Menon
Greenhorn

Joined: Jul 02, 2001
Posts: 6
Hi Jasdev,
All you have to do is to write to the content you want to display on to the browser with HTML tags to a file and name it with .html extenstion.
Runtime.getRuntime.exec("c:\program files\plus!\microsoft internet\IEXPLORER.exe filename.html");
This should trigger a brower with I.E and loads the file.
I Hope I have solved your problem

------------------
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to Redirect Java Command Prompt output to a Browser dynamically?
 
Similar Threads
NumberFormat
controlling Command Prompt window's size?
invoking jvm from other jvm
sql server logs
invoking a standalone app from jsp