You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Raphael Di Cicco <rc...@alphacent.com> on 2002/07/09 10:49:44 UTC

JSP variable problem

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi,

I'm faced with a problem that is maybe really easy to solve...

I have n JSP pages, and they all have a form. Each page contains a JAVA object 
associated to it (called cRessource).

Because I want to keep these objects within the page, this is what I have done 
:
created a cRessource for each page
saved it in the session in a String as this : "myRessource" + index (index is 
unique to each page)
When I have submitted the form, I do a session.getAttribute("myRessource" + 
index)
When I come for the first time to a page I create my ressource and put it in 
the session.


The problem is that this is very heavy in memory, I want to destroy every 
"myRessource" once I quit the page. I tried to use jspDetroy method but :
I have no idea when exactly this is called
I cannot use my index variable in it

I hope I have been clear and someone has an idea on this

Thanks
Raphaël
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE9KqOoh2ITK4xBkFERAq38AJ9DYAEYGBOvQGwNO6RBinptbhHH5wCfcSkn
iSDAXqcoa3ZVHQSFybECJ0E=
=cHmv
-----END PGP SIGNATURE-----


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: JSP variable problem

Posted by Raphael Di Cicco <rc...@alphacent.com>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Well that's in the java doc sorry :

" attributes only persist as long as the request is being handled. "


Le Mercredi 10 Juillet 2002 09:55, Raphael Di Cicco a écrit :
> Thanks I will try that as soon as I can.
>
> But when am I supposed to remove the object inside the request from memory
> ?
>
> Le Mardi 09 Juillet 2002 20:20, David Mossakowski a écrit :
> > If you are making requests of servlets, create cResource there and put
> > it into REQUEST and not session and then forward to the JSP page to
> > display.
> >
> > d.
> >
> > Raphael Di Cicco wrote:
> > > -----BEGIN PGP SIGNED MESSAGE-----
> > > Hash: SHA1
> > >
> > > Hi,
> > >
> > > I'm faced with a problem that is maybe really easy to solve...
> > >
> > > I have n JSP pages, and they all have a form. Each page contains a JAVA
> > > object associated to it (called cRessource).
> > >
> > > Because I want to keep these objects within the page, this is what I
> > > have done
> > >
> > > created a cRessource for each page
> > > saved it in the session in a String as this : "myRessource" + index
> > > (index is unique to each page)
> > > When I have submitted the form, I do a
> > > session.getAttribute("myRessource" + index)
> > > When I come for the first time to a page I create my ressource and put
> > > it in the session.
> > >
> > >
> > > The problem is that this is very heavy in memory, I want to destroy
> > > every "myRessource" once I quit the page. I tried to use jspDetroy
> > > method but : I have no idea when exactly this is called
> > > I cannot use my index variable in it
> > >
> > > I hope I have been clear and someone has an idea on this
> > >
> > > Thanks
> > > Raphaël
> > > -----BEGIN PGP SIGNATURE-----
> > > Version: GnuPG v1.0.6 (GNU/Linux)
> > > Comment: For info see http://www.gnupg.org
> > >
> > > iD8DBQE9KqOoh2ITK4xBkFERAq38AJ9DYAEYGBOvQGwNO6RBinptbhHH5wCfcSkn
> > > iSDAXqcoa3ZVHQSFybECJ0E=
> > > =cHmv
> > > -----END PGP SIGNATURE-----
> > >
> > >
> > > --
> > > To unsubscribe, e-mail:
> > > <ma...@jakarta.apache.org> For additional
> > > commands, e-mail: <ma...@jakarta.apache.org>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE9K+q/h2ITK4xBkFERApycAJoC2Eh8AtojUwATDdU64D6LWwTBrQCfYfu6
tBD2xhhHpTmewlMJFfYYh0I=
=Txr6
-----END PGP SIGNATURE-----


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: JSP variable problem

Posted by Raphael Di Cicco <rc...@alphacent.com>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Thanks I will try that as soon as I can.

But when am I supposed to remove the object inside the request from memory ?


Le Mardi 09 Juillet 2002 20:20, David Mossakowski a écrit :
> If you are making requests of servlets, create cResource there and put
> it into REQUEST and not session and then forward to the JSP page to
> display.
>
> d.
>
> Raphael Di Cicco wrote:
> > -----BEGIN PGP SIGNED MESSAGE-----
> > Hash: SHA1
> >
> > Hi,
> >
> > I'm faced with a problem that is maybe really easy to solve...
> >
> > I have n JSP pages, and they all have a form. Each page contains a JAVA
> > object associated to it (called cRessource).
> >
> > Because I want to keep these objects within the page, this is what I have
> > done
> >
> > created a cRessource for each page
> > saved it in the session in a String as this : "myRessource" + index
> > (index is unique to each page)
> > When I have submitted the form, I do a session.getAttribute("myRessource"
> > + index)
> > When I come for the first time to a page I create my ressource and put it
> > in the session.
> >
> >
> > The problem is that this is very heavy in memory, I want to destroy every
> > "myRessource" once I quit the page. I tried to use jspDetroy method but :
> > I have no idea when exactly this is called
> > I cannot use my index variable in it
> >
> > I hope I have been clear and someone has an idea on this
> >
> > Thanks
> > Raphaël
> > -----BEGIN PGP SIGNATURE-----
> > Version: GnuPG v1.0.6 (GNU/Linux)
> > Comment: For info see http://www.gnupg.org
> >
> > iD8DBQE9KqOoh2ITK4xBkFERAq38AJ9DYAEYGBOvQGwNO6RBinptbhHH5wCfcSkn
> > iSDAXqcoa3ZVHQSFybECJ0E=
> > =cHmv
> > -----END PGP SIGNATURE-----
> >
> >
> > --
> > To unsubscribe, e-mail:  
> > <ma...@jakarta.apache.org> For additional
> > commands, e-mail: <ma...@jakarta.apache.org>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE9K+iIh2ITK4xBkFERAugRAJ9lNKWm6eciDGc+Tpae0X74GA9pXgCffqEe
b8L8azeRUTwvKo2nLF9p1gU=
=JUJN
-----END PGP SIGNATURE-----


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Tomcat LIB and Java CLASSPATH

Posted by "Craig R. McClanahan" <cr...@apache.org>.

On Tue, 9 Jul 2002, Manchan wrote:

> Date: Tue, 9 Jul 2002 10:22:42 -0700 (PDT)
> From: Manchan <pa...@yahoo.com>
> Reply-To: Tomcat Users List <to...@jakarta.apache.org>
> To: Tomcat Users List <to...@jakarta.apache.org>
> Subject: Tomcat LIB and Java CLASSPATH
>
> Can anyone verify this statement?:
>
> "Tomcat Engine reads only the *.jar files located
> within its specified directories, and redefines the
> CLASSPATH variable for its personal use while
> running."
>
> This is how I'm guessing how things are working.
>

Fairly close, although the CLASSPATH environment variable itself is only
used to identify where the startup classes are -- it's not used for
application classes.  This makes sense when you think about it, because
there is only one CLASSPATH but lots of applications ....

The gory details about how class loading in Tomcat works are in the
"class-loader-howto.html" document included in the standard "tomcat-docs"
webapp, and also available online (for whichever version you are running):

http://jakarta.apache.org/tomcat/tomcat-4.0-doc/class-loader-howto.html

http://jakarta.apache.org/tomcat/tomcat-4.1-doc/class-loader-howto.html


Craig



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Tomcat LIB and Java CLASSPATH

Posted by Manchan <pa...@yahoo.com>.
Can anyone verify this statement?:

"Tomcat Engine reads only the *.jar files located
within its specified directories, and redefines the
CLASSPATH variable for its personal use while
running."

This is how I'm guessing how things are working.

__________________________________________________
Do You Yahoo!?
Sign up for SBC Yahoo! Dial - First Month Free
http://sbc.yahoo.com

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: JSP variable problem

Posted by David Mossakowski <dm...@Instinet.Com>.
If you are making requests of servlets, create cResource there and put 
it into REQUEST and not session and then forward to the JSP page to 
display.

d.

Raphael Di Cicco wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> Hi,
> 
> I'm faced with a problem that is maybe really easy to solve...
> 
> I have n JSP pages, and they all have a form. Each page contains a JAVA object 
> associated to it (called cRessource).
> 
> Because I want to keep these objects within the page, this is what I have done 
> :
> created a cRessource for each page
> saved it in the session in a String as this : "myRessource" + index (index is 
> unique to each page)
> When I have submitted the form, I do a session.getAttribute("myRessource" + 
> index)
> When I come for the first time to a page I create my ressource and put it in 
> the session.
> 
> 
> The problem is that this is very heavy in memory, I want to destroy every 
> "myRessource" once I quit the page. I tried to use jspDetroy method but :
> I have no idea when exactly this is called
> I cannot use my index variable in it
> 
> I hope I have been clear and someone has an idea on this
> 
> Thanks
> Raphaël
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.0.6 (GNU/Linux)
> Comment: For info see http://www.gnupg.org
> 
> iD8DBQE9KqOoh2ITK4xBkFERAq38AJ9DYAEYGBOvQGwNO6RBinptbhHH5wCfcSkn
> iSDAXqcoa3ZVHQSFybECJ0E=
> =cHmv
> -----END PGP SIGNATURE-----
> 
> 
> --
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>
> 
> 
> 


-- 
David Mossakowski              dmoss@instinet.com
Instinet Corporation                 212.310.7275



*******************************************************************************
<<Disclaimer>>

This message is intended only for the use of the Addressee and 
may contain information that is PRIVILEGED and/or
CONFIDENTIAL or both.

This email is intended only for the personal and confidential use
of the recipient(s) named above.

If the reader of this email is not an intended recipient, you have
received this email in error and any review, dissemination,
distribution or copying is strictly prohibited.

If you have received this email in error, please notify the sender
immediately by return mail and permanently deleting the copy
you received.

Thank you.

*******************************************************************************


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>