[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
[Home]
Re: Bean Reloading problem
I know this is an old issue, but I am just learning to use JSP and beans
and have a question about what I think is an answer to the bean reloading
problem:
I thought that the problem with reloading beans can be solved by putting
the beans in the servlet repository. From the GnuJSP 0.9.10 INSTALL file,
its says:
"When you using beans from jsp pages, you can put them in one of two
places:
a) in the servlet repository; if GNUJSP has been installed in the servlet
repository, it calls the servlet class loader to laod the beans from
the
servlet repository. If the servlet engine automatically reloads
servlets
when the bean changes, GNUJSP will also be reloaded en therefore reload
the bean as well.
b) on the system classpath; this always works, but the bean will not be
automatically reloaded when it is changed."
However, doing it this way, I get an error:
/usr/web/htdocs/ex-mortg.jsp:1: Can't access class MortgageBean. Only
public classes and interfaces in other packages can be accessed.
I've imported the bean package in my jsp, put my MortgageBean class in the
servlet repository, but I'm getting that error. Can you give me some
advice?
jared
---------- Forwarded Message ----------
To: Vincent Partington <vincentp@xs4all.nl>
Subject: Re: Bean Reloading problem
From: Carsten Heyl <heyl@nads.de>
Date: Tue, 09 Feb 1999 12:49:58 +0100
>Hi Karl and Fritz,
>
>Karl Ostendorf wrote:
>>
>> I'm forwarding this message here as it specifically concerns GNUJSP.
Any id
eas on how to reload beans?
>>
>> ==
>> Karl Ostendorf
>> karl@ostendorf.com
>>
>> _________________________________________________________
>> DO YOU YAHOO!?
>> Get your free @yahoo.com address at http://mail.yahoo.com
>>
>>
------------------------------------------------------------------------
>>
>> Subject: Re: Bean Reloading problem
>> Date: Sun, 7 Feb 1999 14:12:31 -0800
>> From: Karl Ostendorf <kwostendorf@YAHOO.COM>
>> Reply-To: Karl Ostendorf <karl@ostendorf.com>
>> To: JSP-INTEREST@JAVA.SUN.COM
>>
>> ---Fritz Budiyanto <fbudi@MAIL3.VARCOM.NET> wrote:
>> >
>> > Where is the best place to put my beans ??
>> >
>> > I am using JServ 0.97, Apache 1.3.4, and JDK 1.1.7
>> >
>> > If I don't put the bean in the wrapper.classpath, then whenever I
load
>> > any jsp page that access the bean, javac will fire an error, saying
>> > javac couldn't find the bean.
>> >
>> > say this is my try.jsp
>> >
>> > <%@ import="beans.*" %>
>> > ...
>> >
>> > wrapper.classpath=/mybean
>> >
>> > beans is inside /mybean
>> >
>> > Whenever I put my beans into the wrapper.classpath, everything worked
>> > fine, except if I update the bean, jserv will always use the old bean
>> > (never get reloaded since the bean is in classpath)
>> >
>> > Anyone has any suggestion for this problem ?
>> >
>>
>> I have the exact same problem. I'd like to know how to reload beans
>> too.
>
>Currently, the only thing to do is to restart Apache JServ. There is not
>other way to reload classes that have been loaded through the system
classpath
.
>
>However, Ben Engber has sent me a bit of code that causes GNUJSP to use
>the servlet engine's class loader (when properly configured). That code
>should provide a partial solution, but thinking about all this now, it
>seems like complicated stuff. I will investigate more and try to come up
>with a solution.
Sometime ago I wrote a servlet for jhtml-Pages.
Jhtml pages contain <servlet>-Tags and call other servlets.
That stuff uses a class loader initially based on classloader
from jacl. It is able to read from directories, jars and zips.
I hated to restart jserv just to test new servlets so
for debugging pruposes that class loader is able to forget
its classes (the GC seems to care for them getting unloaded).
If its helps I can provide sources.
>
>Regards, Vincent.
>
Ciao,
Carsten Heyl