Refreshing Web Applications

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Refreshing Web Applications

Sandip Ghayal
Hi,

I am new to Jetty. I have integrated jetty with some
other code and
Jetty is started as part of this other code.

I am using simple steps to start up jetty and register
webapps and
storing the context locally for future use.

What I want to do is implement some kind of refresh
facility for webapps.

The way I went about it is, I would just create a new
context for the
web application using addWebApplication method on
Server, and then call
start method on this context(after setting appropriate
parameters). This
web application has a servlet class. When I want to
refresh this web
application, I would replace the servlet class with
the new class and
then call stop method on my old context and then
remove this context
form jetty server with removeContext method.

After this I try to access the servlet thru Internet
Browser, and I
would get response code 404 as expected.

After this I would create a new context for same web
application and
then start this new context. Hoping that it will pick
up the new servlet
class file.

But for some reason next access using web browser
always returned me
back the value from old servlet class. Its almost like
old context is
being used though new context has been created and
should replace old
context which was stopped and removed. (I have
verified that the browser
is not returning me any cached value)

Any idea if this is a bug or am I doing something
different or not doing
something to remove this context?

Thanks,

Sandip


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around
http://mail.yahoo.com 


-------------------------------------------------------
This SF.Net email is sponsored by Oracle Space Sweepstakes
Want to be the first software developer in space?
Enter now for the Oracle Space Sweepstakes!
http://ads.osdn.com/?ad_id=7393&alloc_id=16281&op=click
_______________________________________________
jetty-discuss mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jetty-discuss
Reply | Threaded
Open this post in threaded view
|

Re: Refreshing Web Applications

jan_bartel
Sandip,


Why do you need to create the new WebApplicationContext? Why don't you
just stop it, then copy the new classes and the call start on it again?
Have you had a look at the JMX interface for Jetty which allows you to
stop and restart contexts from the browser - see the readme for
instructions on how to use it.


regards,
Jan


Sandip Ghayal wrote:

> Hi,
>
> I am new to Jetty. I have integrated jetty with some
> other code and
> Jetty is started as part of this other code.
>
> I am using simple steps to start up jetty and register
> webapps and
> storing the context locally for future use.
>
> What I want to do is implement some kind of refresh
> facility for webapps.
>
> The way I went about it is, I would just create a new
> context for the
> web application using addWebApplication method on
> Server, and then call
> start method on this context(after setting appropriate
> parameters). This
> web application has a servlet class. When I want to
> refresh this web
> application, I would replace the servlet class with
> the new class and
> then call stop method on my old context and then
> remove this context
> form jetty server with removeContext method.
>
> After this I try to access the servlet thru Internet
> Browser, and I
> would get response code 404 as expected.
>
> After this I would create a new context for same web
> application and
> then start this new context. Hoping that it will pick
> up the new servlet
> class file.
>
> But for some reason next access using web browser
> always returned me
> back the value from old servlet class. Its almost like
> old context is
> being used though new context has been created and
> should replace old
> context which was stopped and removed. (I have
> verified that the browser
> is not returning me any cached value)
>
> Any idea if this is a bug or am I doing something
> different or not doing
> something to remove this context?
>
> Thanks,
>
> Sandip
>
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around
> http://mail.yahoo.com 
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by Oracle Space Sweepstakes
> Want to be the first software developer in space?
> Enter now for the Oracle Space Sweepstakes!
> http://ads.osdn.com/?ad_id=7393&alloc_id=16281&op=click



-------------------------------------------------------
This SF.Net email is sponsored by Oracle Space Sweepstakes
Want to be the first software developer in space?
Enter now for the Oracle Space Sweepstakes!
http://ads.osdn.com/?ad_id=7393&alloc_id=16281&op=click
_______________________________________________
jetty-discuss mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jetty-discuss