Hi,

Won't the servlet engine reload the servlet if we recompile the .java
classes?  That is not to good for me for I do a bunch of initialization on
the first hit (compiling a xsl stylesheet in particular > 5 seconds;  after
the first hit things are OK), and I would prefer that the session is not
lost.

We solved it by using Jython for all our modules.  This gives the effect
that Jon wants - you can edit your source code and changes are reflected
immediately without a recompile.  The downside is that Jython is a strange
beast at the best of times and we've had to create some workarounds....

I'm not an expert on this so feel free to tell me if I'm being stupid:  Will
it make sense to create a custom class loader for modules?  The custom
classloader can act in the following way:

1.  On the first request it compiles a .java file (ant task or whatever else
makes sense)
2.  On the next request it checks the .java file.
2.1  If it changed the class is recompiled and reloaded
2.2  If it did not change the current class is used

Any thoughts?

I'd be willing to give it a shot if you guys think it is feasible...

~ Leon

----- Original Message -----
From: "Jon Stevens" <[EMAIL PROTECTED]>
To: "turbine-dev" <[EMAIL PROTECTED]>
Sent: Tuesday, August 14, 2001 8:19 AM
Subject: Re: Thinking aloud...


> How about this:
>
> When the Servlet is executed, it runs an Ant build script (it could even
> call Ant's engine directly from Java code without needing to start another
> JVM). The output of the build could be the response back to the browser.
>
> You could add an GET argument such that the servlet would also output a
meta
> refresh HTML tag with the seconds as the value.
>
> Something like:
>
> http://www.server.com/foo/servlet/antExecute?refresh=10
>
> Someone want to take this on...pretty PLEASE with sugar on top?
>
> -jon
>
> on 8/13/01 11:29 PM, "David Hanna" <[EMAIL PROTECTED]> wrote:
>
> > Interesting idea, especially if developers don't have ssh access to
their
> > dev server for some reason.  This type of polling solution might not be
> > the most reliable way however.  Maybe have a master servlet that checks
> > the date of the requested Servlet against it's corresponding java file.
> > If the java file is newer, recompile and hand over control otherwise
just
> > hand over control.
> >
> > My 2 cents.
> >
> > - Dave
> >
> >
> > On Mon, 13 Aug 2001, Jon Stevens wrote:
> >
> >> It seems like a cool enhancement to development with Turbine would be
to
> >> create something (a servlet?) that would spawn a thread that would sit
> >> around in memory and constantly watch for changed .java files in a
> >> particular directory. If one of the files changes, then it could run an
Ant
> >> build script to recompile the .java files. This would make Turbine
"act"
> >> more like JSP.
> >>
> >> Anyone up to implement it? It shouldn't be hard.
> >>
> >> -jon
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to