• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Tim Cooke
  • Jeanne Boyarsky
  • Liutauras Vilda
Sheriffs:
  • Frank Carver
  • Henry Wong
  • Ron McLeod
Saloon Keepers:
  • Tim Moores
  • Frits Walraven
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Himai Minh

can we call jar.. ...

 
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 1228
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Rancher
Posts: 43028
76
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 https://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
 
Montana has cold dark nights. Perfect for the heat from incandescent light. Tiny ad:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic