happy happy - 6 months ago 17
Java Question

JOptionPane in struts?

I am using below code to display dialog box:

if(query.contains(tab)) {
JOptionPane.showMessageDialog(null,"Owner does not have privileges to access given table");
}


But I guess
JOptionPane
wont work in struts. So how to display dialog box in struts?

Can I use
JOptionPane
in struts?

Answer

Of course you can't use JOptionPane in Struts. Struts runs at server-side. JOptionPane would display a Swing dialog on the web server screen, not in the client's browser.

To display a dialog box in a browser, you need JavaScript. You could use jQuery-UI for example.