> Thanks ,
>
> using alert, it seems sometimes its not working so i
> am trying to use this
Using a Swing component in a JSP in place of a Javascript alert seems to be a very backward and complex workaround. I would suggest spending your time trying to determine why alert sometimes fails.
> is there anyway to use swing jOptionpane in JSP, if
> so please let me know.
No, you can't, at least not if you mean "using" as in "displaying it on the client". If that's what you mean, frankly, it shows a severe lack of understanding of the working principles of JSPs. JSPs are executed on the server. All the client ever gets is just another HTML page.