Im与法国统计局网络应用合作。 自2006年以来 Java不支持以直接方式在网络应用中展示信息箱,我决定尝试一些新的想法,认为应当尝试在常规桌面应用中显示信息箱的方法。 为了简单起见,我在Java Servlet.上尝试了以下方法。
JOptionPane.showMessageDialog(null, "A message from Java Servlet.");
without expecting that it would work but it indeed worked and a message appeared on the web browser! I felt that I had found something new but also found that the Glassfish server in my NetBeans 6.9.1 had stopped working in two or three attempts. It turned off with no warning , no error and no exception at all!
The screen shot can be seen below.
Now, if the use of this method in Java web is illegal, it should not be allowed to use this method at all in Java web and some errors or exceptions should be raised when an attempt is made to do so. It should be a compile-time error and if it is so then, how did the message appear through Java Servlet on the web browser? and also, Why did the Glassfish server stop working?