calling exe from servlet (started but not viewed)

D

dinakar31

Hi,
I am using tomcat webserver and jdk1.5.0
I tried to open exe files from servlet and jsp. My problem is that the
program that I am trying to open is started(as I could see it in
windows task manager) but I couldnot find it on screen.
Is there a work around or am I going wrong somewhere.
Here is my code:
 
D

ddimitrov

What exactly do you expect to see?

You won't see a new windows console as the standard in/out is piped
into the Java process that spawned the cmd.exe.

That said, you have to consume the output as otherwise your child
process would block when it fills the OS buffer. Check the javadoc of
the Process class (returned by rt.exec()).

Another class ou might want to check is ProcessBuilder.
 
C

Chris Uppal

I am using tomcat webserver and jdk1.5.0
I tried to open exe files from servlet and jsp. My problem is that the
program that I am trying to open is started(as I could see it in
windows task manager) but I couldnot find it on screen.
Is there a work around or am I going wrong somewhere.

Is Tomcat running as a service ? If so then the notepad.exe will run as
whatever user is configured for that service, and will probably not (and should
not) have access to the desktop.

(BTW, you do /intend/ to open notepad.exe on the server, don't you ?)

-- chris
 
D

dinakar31

Hi,

Actually, I wanted to open a VB application from servlet and need fill
some fields. Is it not possible to give user interaction to the
applications opened from java ? I still have to look into
ProcessBuilder class.

Regards,
Dinakar
 
D

dinakar31

Is Tomcat running as a service ? If so then the notepad.exe will run as
whatever user is configured for that service, and will probably not (and should
not) have access to the desktop.

(BTW, you do /intend/ to open notepad.exe on the server, don't you ?)

-- chris

Ya, Tomcat is running as a service. I just opted for "Allow service to
interact with desktop" and I think it's working, I will post the status
after I confirm the matter.
Thanks chris.

Regards,
Dinakar
 
D

dinakar31

Opted for the 'Access to desktop' option in tomcat service properties
and it worked for me.

Thanx guys,
Dinakar
 
Joined
Sep 16, 2008
Messages
2
Reaction score
0
executing Vb from jsp

Dinakar,

I am new (2 days) to this stuff, but I have to get access to my VB.exe asap from a .jsp. Please show me your servelet and how you did this. I would really appreciate it.. I also do not understand what you meant by allowing access to desktop??? my Test.exe is on C:\ directory. I can run it in command line, but that is all.

Thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,764
Messages
2,569,564
Members
45,040
Latest member
papereejit

Latest Threads

Top