Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
jasdev lamba
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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

------------------
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic