Servlet Needed Urgently

Hi expert,

Hope you can help me with this.

I need a Servlet that I can use to execute an application(exe) from a link via a web page.

Could someone help me with this please?

Thanks

ST3VO
 
ST3VOAsked:
Who is Participating?
 
CEHJConnect With a Mentor Commented:
You can't normally just 'run' a Windows application - it needs installation. You would be better off trying to separate the data your app produces from the application itself and try to reproduce the data.

It's also worth checking whether the app supports embedding as an ActiveX control or .NET equivalent
0
 
CEHJCommented:
How would you stop unauthorised users doing that?
0
 
CEHJCommented:
Assuming you've addressed that properly, read this thoroughly:

http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-traps.html

You'll need to call Runtime.exec in doGet
0
Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

 
objectsCommented:
here u go:

import java.io.*;
import javax.servlet.http.*;
import javax.servlet.*;

public class ExecServlet extends HttpServlet {
  public void doGet (HttpServletRequest req,
                     HttpServletResponse res)
    throws ServletException, IOException
  {
    Runtime.getRuntime().exec("whatever.exe");
  }
}
0
 
CEHJCommented:
That's an excellent example of how *not* to do it. (Read the link i posted)
0
 
ST3VOAuthor Commented:
1 question objects, with the servlet be run from the browser and then the servlet executes my exe?

I've written an application with works with a 3D engine and I need to users to be able to run it from a link on the html page.

Due to security issues, this is not possible, so after some research I read that this was possible via a Java Servlet...so that's why i'm posting here :o)

I have no experience with java at all. Do I need to comile your code objects?  Could you point me to some tool to do this please?

Sorry about that...I know nothing about Java :o)

Thanks

ST3VO
0
 
objectsCommented:
> 1 question objects, with the servlet be run from the browser and then the servlet executes my exe?

yes, servlkets run server side

What exactly does the exe do, whats the output?

You may actually want to run it client side, in which case you could use some signed java code to execute it.
0
 
CEHJCommented:
>>I read that this was possible via a Java Servlet...so that's why i'm posting here

It might be possible. What kind of output does your program have? If it has a GUI, you won't be able to do it without a lot of difficulty
0
 
ST3VOAuthor Commented:
We yes, it uses DirectX and Windows GUI :o/
0
 
objectsCommented:
then you'll need to run it client side which would require signed code.
Pretty straight forward, you just need a certificate.

Why are you using Java btw?
0
 
objectsCommented:
user could just download the exe directly and run it themselves.
0
 
ST3VOAuthor Commented:
Yes, but the prolem is that I need to do it via a web link and due to permission the browser will not let ths happen.
0
 
objectsCommented:
browser won't let you run it, but they can still download it. And include instructions on the page about how to run it once they have downloaded.
A Lot simpler than use signed code to download and execute it.
0
 
ST3VOAuthor Commented:
I've already got it working that way but I am required to do it via the brower :o/
0
 
CEHJCommented:
Then you should provide the kind of interface i mentioned above
0
 
ST3VOAuthor Commented:
Thanks guys !!!
0
 
objectsCommented:
Then perhaps you should be going down the .NET route instead of Java
See if this is applicable

http://www.devhood.com/tutorials/tutorial_details.aspx?tutorial_id=187

To do it with Java you'd need to use signed code to download the exe, save it to the local disk and then execute it. Not the cleanest of solutions.
0
 
CEHJCommented:
:-)
0
 
ST3VOAuthor Commented:
THanks again!!!

0
 
objectsCommented:
glad I could help :)
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.