title: how can i execute html tag on jsp page using javascript?
body: <p>i want to execute paragraph tag on jsp page from the servlet response.I am able to execute alert of javascript but failed to execute below code. it is redirecting to servlet and then getting execute. I want below code in NewFile.jsp any solution for this.</p>
  
  <pre><code>protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
      response.setContentType("text/html");//setting the content type  
      PrintWriter out=response.getWriter();//get the stream to write the data  
  
  
      out.println("&lt;script type=\"text/javascript\"&gt;");
      out.println("document.write(\"&lt;p&gt;Hello JavaScript by JavaScript&lt;/p&gt;\");");
      out.println("location='NewFile.jsp';");
      out.println("&lt;/script&gt;");
      out.close();
  }
  </code></pre>