Hi, Sanjeev.
Thanks a lot for your information.
Let me clearify my problems.
My main applet class is called StatApplet.java which
is loaded in StatApplet.html. In this StatApplet.java,
i  create a JeditorPanel which is associate with the
Servlet application called Section1Servlet.java via
sumPane3 = new JEditorPane(new
URL("http://root/servlet/Section1Servlet";));
So far it works well.
In Section1Servlet, It invoke another servlet
ShowSection.java by
response.sendRedirect("/root/servlet/ShowSection1").
The problem now comes up. The ShowSection1 is invoked
two times. after that,
another servlet called ShowResult.java is invoked from
ShowSection1.java. also it is invoked two times. what
is more, all attributes bound to session are lost.

I test these servlets without applet. They works well
together. but when i embed these application in
Applet.These problems come out.

Also the tomcat becomes select tomcat and quit
working.
the following are part of my attachement


--- Sanjeev Verma <[EMAIL PROTECTED]>
wrote:
> It would help if you send relevant snippets of the
> servlet and applet code.
> Understanding from what you have said, it probably
> looks like an applet
> lifetime related problem, becoz' of which your
> servlet gets invoked twice.
> Inside which method of the Applet are you invoking
> the servlet? Search for
> your bug thier.
>
> Regards
> Sanjeev
>
> -----Original Message-----
> From: bin cai [mailto:[EMAIL PROTECTED]]
> Sent: Friday, September 27, 2002 1:53 AM
> To: [EMAIL PROTECTED]
> Subject: Why the servlet is called two times
>
>
> Hi,
> currently i am encountering such problem. I guess it
> is caused by applet and servlet.
> I wrote two servlet calss called Retrieve.java and
> showInfo.java.
> In Retrieve.java, the sytem get information from
> database and put the info in session. then invoke
> ShowInfo.java by
> response.sendRedirect("/root/servlet/ShowInfo").
> These
> are simple and works well.
> But when i embed these two servlets into java
> applet,
> it works rare.
> in applet i have JeditorPanel which is associate
> with
> Retrieve.java. when applet is loaded, the
> Retrieve.java is invoked and then invoke
> ShowInfo.java. but the problem is the ShowInfo.java
> is
> invoked two times and the session is invalidated.
> So the following sevelet class can't get parameters
> from session.
> I spend a lot of time trying to find the bug. just
> failed.any one can help me out, really appreciate
> bin
>
>
______________________________________________________________________
> Post your free ad now! http://personals.yahoo.ca
>
>
___________________________________________________________________________
> 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
>


______________________________________________________________________
Post your free ad now! http://personals.yahoo.ca

___________________________________________________________________________
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