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

[1414 byte] By [muthu2007a] at [2007-11-27 9:45:39]
# 1
Your HTML is simply bad.
BalusCa at 2007-7-12 23:54:39 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...