• Post Reply Bookmark Topic Watch Topic
  • New Topic

can we call jar.. ...  RSS feed

 
Pendurthi prashanth
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi!..

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
P-r-e-s-i
 
Srinivasa Raghavan
Ranch Hand
Posts: 1228
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Ulf Dittmer
Rancher
Posts: 42972
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
Pendurthi prashanth
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you guys 4 your replies

Its really dumb to do that with JSP..

But Yeah I've learnt some..


Thanks once again..

P-R-E-S-I
 
Pendurthi prashanth
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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

P-R-E-S-I
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!