Hi all,
I guess this draws us to the basics of applet-servlet communication.
I guess the applet-servlet communication is based on HTPP tunneling wherein
the webtop applet will be the client and the servlet running in the
webserver. HTTP protocol allows for the webclient to send a message to the
webserver and the webserver to send a reply back to the client. It is
session based and the entire process is client initiated.
For that matter asynchronous notification to the webclient will not be
possible from the servlet.
Am I right ???
-Karthik
>From: AMIT BHATIA <[EMAIL PROTECTED]>
>Reply-To: "A mailing list for discussion about Sun Microsystem's Java
> Servlet API Technology." <[EMAIL PROTECTED]>
>To: [EMAIL PROTECTED]
>Subject: Re: [Re: applet calls servlet or servlet calls applet:]
>Date: Sat, 9 Sep 2000 00:08:00 IST
>
>hello gwen,
>
>it should be at Applet calling the Servlet & not vice-versa as Applets, by
>themselves, cannot talk to the server. they do so with the help of Streams.
>
>you have to first make an applet. in the applet, specify an object of the
>URL
>class, the URLConnection class & of course, the DataInputStream class. the
>URLConnection class will make the connection b/w the applet & servlet.
>
>well, you must go by the following steps:
>
>1. create an applet calling the servlet.
>2. create a servlet performing yr jdbc tasks.
>3. create an html page calling the applet.
>4. if u r using Java Web Server 2.0, compile the applet file & the servlet
>file.
>5. copy the applet.class file & the html page in the "public_html" folder.
>6. copy the servlet.class file in the "servlets" folder.
>7. in yr browser, call "http://hostname:port/html.html", the html page that
>u
>created & copied in the pubic_html folder.
>
>but, u must remember to use response.setContentTYpe("text/plain") in yr
>servlets file. this is b'coz applets communication is in simple ASCII
>format.
>
>well, i hope to have clarified some of yr doubts. any suggestions on this
>will
>be appreciated.
>
>best regards,
>amit bhatia.
>
>
>
>
>"S.A.Pamungkas" <[EMAIL PROTECTED]> wrote:
> > Hi Gwen
> >
> > Make html file including <APPLET> tag.
> > In applet use ( for example )
> > URLConnection con = url.openConnection();
> > to connect servlet.
> >
> > There are nice samples and explanation about
> > applet-servlet communication in Jasson Hunter's book (
> > Java servlet programming ).
> >
> > Or please go to
> > http://www.j-nine/pubs/applet2servlet/index.htm
> >
> > Regard,
> >
> > - pamungkas (sajip) -
> >
> > --- meh_PY <[EMAIL PROTECTED]> wrote:
> > > Hi all,
> > >
> > > I am a bit confuse with all the reading that I have
> > > read
> > > Shd it be applet calls servlet or vice versa?
> > > In addition, there is a need for me to accesss data
> > > from the database. So, which one shd come first &
> > > who one to call who?
> > > database called by -> JDBC ???
> > > JDBC called by -> apple / servlet ???
> > > If applet is the one to call servlet, does it mean
> > > that i shd have a html file that calls applet & have
> > > something in the applet file that calls servlet. How
> > > can i connect the above few?
> > >
> > > I have written a testing program that has servlet to
> > > call applet & view the pg using the servlet.
> > > That is, http: host name:port/servlet/servlet-name
> > > However, there is a 'applet class not found'
> > > message.
> > > Is it the problem with the way i have the servlet
> > > calling the applet?
> > >
> > > Pls render help.....thks!!!
> > >
> > > :)Gwen
>
>
>____________________________________________________________________
>Get free email and a permanent address at http://www.netaddress.com/?N=1
>
>___________________________________________________________________________
>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
_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.
Share information about yourself, create your own public profile at
http://profiles.msn.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