Hi Abhay,
Thanx for your help.
I've changed my coding as u had suggested,but still i'm getting the same
error.So how can I hide a java script function inside a servlet program(ie)
what tags should i use.I think that the problem is with that tag.
Looking forward to your reply.

Karthikeyan A.R


-----Original Message-----
From: A mailing list for discussion about Sun Microsystem's Java Servlet
API Technology. [mailto:[EMAIL PROTECTED]]On Behalf Of Abhay
Sent: Friday, November 24, 2000 4:47 AM
To: [EMAIL PROTECTED]
Subject: Re: Java Script functions within Servlets


HI Karthikeyan,
    There are a few things to be noted.

1.    U can not hide javascript by <!--  ...   --> tags. The way u have done
should give syntax error
2.    Secondly, in body tag, keep entire < body onload=' .......  '> in one
line. Otherwise it will give error saying "String not terminated at

<Body ..... onload =  openWindow
 'http://localhost:8080/examples/servlet/testing','testing','scrol
lbars = no'>

Do it & u won't face the problem.


Abhay


----- Original Message -----
From: A.R.Karthikeyan <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, November 23, 2000 9:22 PM
Subject: Re: Java Script functions within Servlets


> Hi everybody,
> I have been trying to execute a java script function during the Onload
event
> of a html page generated by a servlet.The code is below:
>
> import java.io.*;
> import javax.servlet.*;
> import javax.servlet.http.*;
>
>
> public class Script extends HttpServlet
> {
>
> public void doGet(HttpServletRequest req,HttpServletResponse res) throws
> ServletException,IOException
> {
> PrintWriter out = res.getWriter();
> res.setContentType("text/html");
>
> out.println("<html> <head> <script language = JavaScript>");
> out.println("<!-- function openWindow(theURL,winName,features) {");
> out.println(" window.open(theURL,winName,features);} -->");
> out.println("</script>");
> out.println("</head>");
> out.println("<body bgcolor= #FFFFFF leftmargin= 0 topmargin= 0
marginwidth=
> 0 marginheight= 0  onLoad=
>
openWindow('http://localhost:8080/examples/servlet/testing','testing','scrol
> lbars=yes,resizable=no,location=no,width=768,height=550')>");
> out.println("<p>Start</p>");
> out.println("</body> </html>");
> }
> }
> So as u can see as soon as a call to the Script servlet is made
> simultaneously another window with the output of the test servlet should
> also get loaded,but I am getting a Java script error on the 6th
out.println
> statement (ie) where the body tag begins,stating Object required on line 6
> char 1.Is there any mistake of escaping the values of the properties of
the
> body tag.
> Can anybody help me out with this problem!!
> Anticipating your help.
> Thanx in Advance
>
> Karthikeyan A.R
>
>
___________________________________________________________________________
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the
body
> of the message "signoff SERVLET-INTEREST".
>
> Archives: http://archives.java.sun.com/archives/servlet-interest.html
> Resources: http://java.sun.com/products/servlet/external-resources.html
> LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
>

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to