我使用下面的代码来显示对话框:
if(query.contains(tab)) {
JOptionPane.showMessageDialog(null,"Owner does not have privileges to access given table");
}
但我猜 JOptionPane
在 struts 中不起作用。那么struts中如何显示对话框呢?
我可以在struts中使用JOptionPane
吗?
最佳答案
当然你不能在Struts中使用JOptionPane
。 Struts 在服务器端运行。 JOptionPane
将在 Web 服务器屏幕上显示 Swing 对话框,而不是在客户端浏览器中。
要在浏览器中显示对话框,您需要 JavaScript。您可以使用 jQuery-UI例如。
关于java - Struts 中的 JOptionPane?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11220834/