Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Knute Snortum
  • Bear Bibeault
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Frits Walraven
  • Carey Brown
  • Tim Holloway

How to include an executable file in JSP

 
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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:
 
Ranch Hand
Posts: 1467
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Vasanth,
I came across this code snippet in our IO forum from Carl. Please check.

regds
maha anna
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!