You need javascript to do this. Create a small form with submit button, the
form action points to your servlet. Inside the page onLoad event, use code
to click the subtmit button. The servlet should return SC_NO_CONTENT status
code so you can stay on the same page after submission.

For latest browser (version 4.0 and above for both IE and Netscape), you can
put this form in a division <div> and make the division invisible.

Bing

-----Original Message-----
From: Yu, Meng
To: [EMAIL PROTECTED]
Sent: 4/18/00 7:09 PM
Subject: Re: Invoke a servlet in html

Regarding about this issue, i am really interested to know how to
trigger
the servlet as soon as the html page is loaded, and still stay on the
same
html page? The purpose of this is to pass some local info to servlet.

My solution is just write an applet, then use javascript to call applet
to
tranmit data to servlet.

This sounds troublesome. I hope there are easy solutions which can call
servlet directly from javascript. Any of your advice will be highly
appreciated.

-Meng

> -----Original Message-----
> From: Sandeep Malhotra [SMTP:[EMAIL PROTECTED]]
> Sent: Tuesday, April 18, 2000 6:04 AM
> To:   [EMAIL PROTECTED]
> Subject:      Re: Invoke a servlet in html
>
> Do you want to trigger the servlet as soon as this html page is
> loaded...is
> that what you mean?!
>
>
> ----- Original Message -----
> From: Jinfeng Ni <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Monday, April 17, 2000 10:53 PM
> Subject: Invoke a servlet in html
>
>
> > hi,
> >       I meet a problem. I want to run a servlet when user open
> > one html. I edit the html file like this:
> >
> > <html>
> > <head>
> > <title>Untitled Document</title>
> > <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
> > </head>
> > <body bgcolor="#FFFFFF">
> > <script language="JavaScript" src="/servlet/Hello">
> > </script>
> > </body>
> > </html>
> >
> > ==========================================
> > But it failed. I  was told that there is a syntax error!
> >
> > How to implent this request?
> >
> > Any help will be appreciate!
> >
> > Jeff Ni
> >
> >
> > _____________________________________________
> > 263~{JW6<TZO_~}--~{VP9zHK5DMxIO<RT0~} http://www.263.net
> > ~{>+2J!"Cb7Q!";9D\J!IOMx7Q#,?l6)TDKwRW5gWS?/No#!~}http://www.soim.com
> > ~{;}#(SE#)5c#,;;#(=1#)F7#!~}http://www.thepoints.com
> >
> >
>
________________________________________________________________________
__
> _
> > 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

___________________________________________________________________________
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