File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Executing jars from jsp

 
Bony Sen
Greenhorn
Posts: 23
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I need to make a jsp in which I have to provide links to various java applications.
Is it possible to define the link in such a way that the application associated with that link is executed on clicking the link?

Thanks
 
Seetharaman Venkatasamy
Ranch Hand
Posts: 5575
Eclipse IDE Java Windows XP
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
application needs to be execute on client side or server side?
 
Bony Sen
Greenhorn
Posts: 23
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Server-side
 
Seetharaman Venkatasamy
Ranch Hand
Posts: 5575
Eclipse IDE Java Windows XP
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
use different action or one action with different param value
 
Bony Sen
Greenhorn
Posts: 23
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Could you please elaborate with an example illustrating the syntax.
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What do you mean by "executing jars"?
 
Bony Sen
Greenhorn
Posts: 23
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
We have a jar file of the code which we run through command prompt using:
java <Classname> <parameters>
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Depending on your actual needs it may just be easiest to exec them... this strikes me as an odd way to go about this, but it's hard to say with not much info to go on.
 
Bony Sen
Greenhorn
Posts: 23
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have got jars created for various applications which are normally run via command prompt. I want to provide the user easy access to these applications by providing links for these in a web page. Is it possible to execute such an application(in jar form or otherwise) through a jsp?
 
Wayan Saryada
Ranch Hand
Posts: 105
IntelliJ IDE MySQL Database Tomcat Server
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Did you mean that you want executing applications like Java Swing applications? Maybe what you are you looking is something like Java Web Start?
 
Chris Hurst
Ranch Hand
Posts: 443
3
C++ Eclipse IDE Java
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Add a servlet to execute your jars, use the java ProcessBuilder class. Your jsp can either send the servlet the actual text to execute (massive security hole) or a description of the 'jar' it needs to execute and have the servlet construct the actual command to execute eg java -jar command. As the commands you are executing are actually java it does beg the question as to why you don't just link use them directly ??
 
Don't get me started about those stupid light bulbs.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic