Forums Register Login
can we call jar.. ...

Once again I'm in argument with my college. The Question is..

Can we call jar file using java.lang.runtime using jsp ?
The jar file contains a class which creates a JFrame.

I say that if any native call which is not terminated automatically will issue and error.

She says there should be a way and what I reasoned is wrong.

Please settle our argument.

Thanks in advance
A jar utility can be called Using java.lang.runtime.exec provided it's added to the appropriate path . But i feel JSP is not the right place for this. JSP should be used for rendering a webpage.
Several points:

- The previous post is spot on, it is very bad design to have a JSP do a Runtime.exec.
- The server may be "headless" -i.e. have no windowing system-, or the web server may not be allowed to open windows. In both cases this call will fail.
- The newly created process is independent of the JSP. Whether it is still running when the JSP is done rendering has no bearing on it. It will continue to run afterwards.
- All of which begs the question: What is the point of running a GUI process on the server?
Thank you guys 4 your replies

Its really dumb to do that with JSP..

But Yeah I've learnt some..

Thanks once again..

Hi once again!

Previously I've posted a topic on calling a jar file..

Hope this link takes you there http://www.coderanch.com/t/327768/java/java/we-call-jar

The reason I choose to run a seperate program is, that part of process is a heavy-weight operation. So, Instead of keeping stress on the server which has other important jobs to handle, I've decided to run a seperate program using java.lang.runtime.exec ...

Is my design correct?

Are there any flaws...!! (there are bound to be .. Just let me know).

Is there any specific way of communication between the stand-alone-jar-utility and the server..???

Please help.. I'm in a dialema!!!

Thanks in Advance


This thread has been viewed 796 times.

All times above are in ranch (not your local) time.
The current ranch time is
Nov 19, 2018 04:40:51.