Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

applet - servlet communication

 
Neo Wills
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I have an applet and wanted to pass a string to the servlet and make the servlet execute a file in the server. Iam using Tomcat 4.1. The connectivity between the applet and servlet is proper. But the servlet doesnt execute the Exec() command. I have no idea why. Can you please look into it and help me out?


[ December 30, 2006: Message edited by: Bear Bibeault ]

[BSouther: Added UBB CODE tags]
[ December 30, 2006: Message edited by: Ben Souther ]
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64969
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In future posts, please refrain from using all upper-case for your titles. I have updated this one for you.
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Does it really not execute it? You mean in the sense that it is skipping it? That would be strange. Have you ascertained that the statements before and after are executed? Is there no stack trace? You might also want to read up on the pitfalls of using Runtime.exec.

[ UD: fixed URL ]
[ December 31, 2006: Message edited by: Ulf Dittmer ]
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why of all things did you choose notepad.exe (a gui program with no input or output)?
How do you know it wasn't called.

If I were doing something like this, I would write a small batch script that writes something to a file, like...


Then call that batch script from your servlet and see if it wrote the file.
 
Neo Wills
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi first iam sorry for the upper case subject in the post....

I wanted to see if it exec is working properly and ran notepad.... the problem is that when i run it notepad isnt executed....but when i give a waitFor() on this process, the statements after it are not executed ....

Shall try with the batch file as well in a few mins...
 
Neo Wills
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
It worked with the batch file running the exe but not when i directly run it... no idea why its wierd.... thanks a lot anyways..

Bharath
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic