Look before you leap! The question was
- given LeftFrame is a servlet
- code is LeftFrame lf=new LeftFrame();
- will this create a new instance?
Yes, if you use the operator new, this will create a new instance. This
will not be the same instance that jserv uses, and there will be no
connection between the two instances. If a request for LeftFrame comes
to the server, that request will be directed to to jserv's instance of
LeftFrame, not the instance created by the code.
To Purav:
While it is possible to do what you are trying to do, it is not a good
idea. It would be better to create the frames and cause the browser to
make the request for the LeftFrame servlet. Information on how to do
this was posted earlier today. Look for a message with the title "HTML
Generation to a Frame."
Laheeb Alsarraf wrote:
>
> All servlets have only one instance in memory. This is the way jserv works.
>
> -----Original Message-----
> Purav wrote:
>
> I have a webpage which has a left navigation menu
> What i have done is made a Servet called LeftFrame and Called it In other
> Servlets so that i dont have to rewrite the code
>
> This is the code
>
> LeftFrame lf=new LeftFrame();
> lf.doGet();
>
> Now my question is
> Since i am creating a new instance here . I am confused whether it will use
> the LeftFrame already loaded in Memory or everytime it will create a new
> instance
> How different will this be from a normal servlet Behaviour or will it be the
> same
___________________________________________________________________________
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