wood burning stoves*
The moose likes JSP and the fly likes Invoke Windows/DOS commands from JSP? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » JSP
Bookmark "Invoke Windows/DOS commands from JSP?" Watch "Invoke Windows/DOS commands from JSP?" New topic
Author

Invoke Windows/DOS commands from JSP?

Veni Velkoor
Ranch Hand

Joined: Oct 17, 2001
Posts: 65
Hello,

I am trying to invoke a Windows command (such as explorer.exe or cmd.exe) through a JSP that I have. I can't seem to get the JSP to recognize these commands through an <href> or any command. How does one accomplish this?

Specifically what I am try to do is invoke Windows explorer with a path such as C:\temp ..this path is passed to me as a variable in this JSP.

Any help/advice will be greatly appreciated. I have already attempted to search for this on this forum and haven't come up with any results.

Thanks much!
Veni
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61310
    
  66

On the client or the server?

If on the client, completely impossible -- thank goodness.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Veni Velkoor
Ranch Hand

Joined: Oct 17, 2001
Posts: 65
Bear,

Thanks for the response. Ideally we wanted to open the folder on residing on a server from a client.

What if it were are shared folder with open access to all? What our project is trying to do, is allow users to open loan docs which are located in a shared-central location when they book loans...more for reference.

Do you think there is a way to do this?

Thanks
Veni
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61310
    
  66

Why not just create links to the docs on the server? Why do you feel the need for DOS commands?
Veni Velkoor
Ranch Hand

Joined: Oct 17, 2001
Posts: 65
Bear,

We did that for another feature. But in this case, the number of docs may be huge 200+ and there are several such folders. So, rather than go through the maintenance of creating links to individual docs, we were hoping to give them access to the folder so that they can pick and choose what they want to view.

Any suggestions of work-arounds are most welcome.

Thanks
Veni
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61310
    
  66

Ummm, you're using JSP, no? Auto-generate the links.
Veni Velkoor
Ranch Hand

Joined: Oct 17, 2001
Posts: 65
Bear,

You are right, we can auto-generate links. But the file names are not standardized nor are the formats. So we have to potentially come up with a mechanism that does that.

In this particular case, since this app is completely internal, we were hoping that there may be a way to open a folder in Windows explorer from where the user can choose which file to view.

Thanks
Veni
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61310
    
  66

Originally posted by Veni Velkoor:
But the file names are not standardized nor are the formats. So we have to potentially come up with a mechanism that does that.


That's where I think your time would be best spent. With JSP, you're not going be able to give them Explorer-like access. The best you'll be able to do is to allow directory listings. But that, of course, opens up a bunch of security issues.

Perhaps a WEBDAV solution might be more appropriate.
 
 
subject: Invoke Windows/DOS commands from JSP?