aspose file tools*
The moose likes Servlets and the fly likes How to include an executable file in JSP Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "How to include an executable file in JSP" Watch "How to include an executable file in JSP" New topic
Author

How to include an executable file in JSP

Anonymous
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
How do i include an executable file in a JSP page & if required make use of any variable in that file with in the JSP?
Executable file may be C,C++ or any file
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12682
    
    5
I'm assuming you want to include the output of the executable file, not the file itself. You can use Java's exec() capability to execute programs on the server with input from Java and output captured to an output page.
I would not use that code inside a JSP page directly - it gets too hard to read and REALLY tricky to debug. Create a Bean to handle the execution and you can debug the Bean off-line.
<shameless-plug>There is an example of executing a Perl script from a servlet in my book, also a debugging utility.</shameless-plug>
Bill

------------------
author of:


Java Resources at www.wbrogden.com
maha anna
Ranch Hand

Joined: Jan 31, 2000
Posts: 1467
Vasanth,
I came across this code snippet in our IO forum from Carl. Please check.

regds
maha anna
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to include an executable file in JSP
 
Similar Threads
Count of servlet file
How to add C program executable inside a HTML file
How to include C executable inside a HTML file
Insert 2nd class tu main class
include a JSP file