When I am going to click on button, I want to execute jar file which is on server.
Is it possible to execute jar file onClick event of button?
Note: Jar is on server. Jar functionality is that, it edit some files which are in client machine.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Well, theoretically you can, but you should have an idea of what all this implies. If you add a “button” into your JSP page, like some Javascript widget or an
<input type=button"/>all this will arrive in the user’s browser as HTML code. When the guy clicks it or does something in that HTML page (which was generated by the JSP) all you (the developer) can do with it is send it asan HTTP command back to the server (like when he clicks the button you can call the link http://myServerAddress:8080/myUrl). Now in the servlet or whatever dynamic component you have answering for that URL you can do whatever you want, load a jar file, call some method from some class inside that jar, you can even use the Runtime to execute an OS command (tho that would no longer make your app OS agnostic) like , “java -jar myJar.jar”. Then you can return the response of that execution/call back to the user by either sending back the console output, or redirecting/forwarding him to a different page, etc.