Reputation: 1
I am fighting for a solution in Java Webstart.
I am working a project in which we use Weblogic as Application Server and Struts, Spring & Hibernate are the technologies.
We have a requirement to invoke an application which was installed in a clients desktop.
For that I have used Java WebStart. It contains a simple Java standalone program with main method which will invoke the application on clients desktop.
It looks as below.
public static void main(String[] args)
{
try
{
Runtime rt = Runtime.getRuntime();
Process pr = rt.exec(args[0]);
}
catch (Exception e)
{
e.printStackTrace();
}
}
Everything works fine. I am able to invoke the application.
But if there is any failure in invoking the application then the control comes to the catch block. But there is no message displayed to the user saying that the invocation of the application failed.
Is there any way to display a message to the user saying that the application invocation failed or at least send back the control to the server.
Upvotes: 0
Views: 176
Reputation: 168825
catch (Exception e)
{
e.printStackTrace();
JOptionPane.showMessageDialog(
someParentOrNull,
e.getMessage(), // experiment with the exact form of the message
e.toString(), // experiment with the exact form of the title
JOptionPane.ERROR_MESSAGE);
}
Upvotes: 1