title: How to use javascript alert boxes in Liferay Portlet class?
body: <p>The requirement is to show an alert box from portlet class after saving some data.<br>
  How can I do this?</p>
  
  <p>Can we create <code>PrintWriter</code> object in Portlet class, using <code>actionresponse</code> of <code>processAction()</code> method?</p>
  
  <p>Following code is not working...</p>
  
  <pre><code>PrintWriter out = actionresponse.getWriter();
  String str = "/web/guest/newpage.jsp";
  out.println("&lt;script language=\"Javascript\"&gt;");
  out.println("alert(\"SAVED\");");
  out.println("window.location.href=\'"+str+"\'; ");
  out.println("&lt;/script&gt;");
  </code></pre>
  
  <p>How to do it? Please help..</p>