Skip to Main Content

Java SE (Java Platform, Standard Edition)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

Desktop class problem

843807Aug 11 2010 — edited Aug 12 2010
The code below does nothing. No file opened, no exception thrown, no output.
What can I do to discover the problem?
It does indeed execute the desktop.open(file) line.
Using JDK 1.16.0_81
File file = new File(pathAndFileString); // an existing text file
if (Desktop.isDesktopSupported()) {
	Desktop desktop = Desktop.getDesktop();
	if (desktop.isSupported(Desktop.Action.OPEN )) {
		try {
			desktop.open(file);
		} catch (IOException e1) {
			e1.printStackTrace();
		}
	}
	else {
		System.out.println("Desktop.Action.OPEN not supported");
	}
}
else {
	System.out.println("Desktop not supported");
}

Comments

843835
your question is not exactly clear to me.
There are many ways to communicate with Servlet from JSP, depending upon what you need to do.
like forward the request to Servlet, Redirect to Servlet or Submit to Servlet page.( just like you call jsp from jsp). because jsp's are nothing but Servlets in the background.
843835
your question is not exactly clear to me.
There are many ways to communicate with Servlet from JSP, depending upon what you need to do.
like forward the request to Servlet, Redirect to Servlet or Submit to Servlet page.( just like you call jsp from jsp). because jsp's are nothing but Servlets in the background.
the background.
1 - 2
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Sep 9 2010
Added on Aug 11 2010
8 comments
3,601 views