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

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

asp.net - In javascript how to find the height and width -

c# - DataTable to EnumerableRowCollection -