How can i include java script within java servlets
Hi guys
I had one doubt
whether we had write java script with in servlets
I just writethis code but it will not work?
Any one can solve the problem
publicvoid doPost(HttpServletRequest request, HttpServletResponse response)throws ServletException, IOException
{
StringBuffer sb;
out.println("<html>");
out.println("<head>");
out.println("<script language = 'javascript'>");
out.println("<body onload = 'window.print()' >");
out.println("</head>");
out.println("<body>");
sb.append("<html>");
sb.append("<head>");
sb.append("welcome>");
sb.append("</head>")
out.println("</html>
}
When i callthis page the body onload method will not executed why?
Any body pls help me
Thanks in advance
Regards
Muthu

