It appears you have not yet registered with DEVPPL. To register please click here... (it's fast, easy and free!)

Forum

Log In Sponsors
Board index Programming Java Forum

How to call exe from jsp dynamically without hardcoding file

How to call exe from jsp dynamically without hardcoding file

Postby kyawmyothet on Mon Apr 16, 2007 7:36 am

Hi all,
I face some problem, I want to run exe from JSP. I can run it but I need to give full path of file. I want to call dynamically without hardcoding fullpath. Just giving filename.

I don't want

exec ("C:\Program File\Coro\sign.exe");

I want

exec("sign.exe")
kyawmyothet
 
Posts: 3
Joined: Mon Apr 16, 2007 7:30 am

Postby ggomez on Tue Apr 17, 2007 3:56 am

If you put the file.exe where the file.class is, you wont need the fullpath.(a copy of the file.exe should do it).

you also could make a method that look for the archive for all the hard disk(not recommended).

you can make a list of all the fullpaths and extract them from a file to your program.

this is everything i can think right now.

i just can tell that java wont do the searching for you.
ggomez
 
Posts: 45
Joined: Tue Apr 17, 2007 3:30 am
Location: !!!!!MéXiCo¡¡¡¡¡¡

Postby kyawmyothet on Tue Apr 17, 2007 4:18 am

Thank so much for reply. But my problem is "In my jsp I need to create one buttom that will run one of window program that user install it. User will install any drive (C,D,E) or will also change any folder name. So If I hardcode to call this exe, my hardcode and user choice is different, problem come."
kyawmyothet
 
Posts: 3
Joined: Mon Apr 16, 2007 7:30 am

let see....

Postby ggomez on Tue Apr 17, 2007 5:25 am

mmmm....

i understand.

but the JSP only run in the server side, and then send or generate the html page presented in the browser.

im assuming that you will use the forms of the html code beacause you cant use swings either, and still the jsp instructions only run in the server side.

you said that it worked for you, if you tested it in the server that make sense but it will never work in a client side.

i´ve read that using activeX you could do something like that but dont take this to serious.
ggomez
 
Posts: 45
Joined: Tue Apr 17, 2007 3:30 am
Location: !!!!!MéXiCo¡¡¡¡¡¡

Postby kyawmyothet on Tue Apr 17, 2007 5:57 am

Thank so much, you are right, it never work at client side. Can we do this from java script? or How I can do other way to run at client side?
kyawmyothet
 
Posts: 3
Joined: Mon Apr 16, 2007 7:30 am

Postby ggomez on Tue Apr 17, 2007 6:06 am

i know so little about some other stuffs thats not java but like i said

i´ve read that maybe with activeX or yes maybe with javascript,

the problem is that most computers have all this functions disabled or well controlled.

if this for a LAN network maybe you should try a simple application but for internet it looks difficult to me.
ggomez
 
Posts: 45
Joined: Tue Apr 17, 2007 3:30 am
Location: !!!!!MéXiCo¡¡¡¡¡¡


Who is online

Users browsing this forum: No registered users and 0 guests