servlets - javascript dialogbox without opening page -


i have display dialog box servlet without opening new window.

below code

printwriter printwriter =response.getwriter();  string s ="<html><head><title>javascript example</title>"+ "<script language=javascript>"+  "alert('file uploaded');"+  "</script>"+    "</head>"+   "</html>"; 

printwriter.print(s);

this code open dialog in new window want dialog in current window.

it's hard understand problem. posted code isn't opening new window @ all, it's displaying alert dialog. if mean opening new window and displaying alert, problem rather lies in calling code. maybe have target="_blank" in link or form calling servlet?


that said, generating view code in servlet isn't best practice. jsp should used that.


Comments

Popular posts from this blog

windows - Why does Vista not allow creation of shortcuts to "Programs" on a NonAdmin account? Not supposed to install apps from NonAdmin account? -

c++ - How do I get a multi line tooltip in MFC -

unit testing - How to mock PreferenceManager in Android? -