By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,541 Members | 1,109 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,541 IT Pros & Developers. It's quick & easy.

Servlet Problem: Always Load old java servlet class

P: n/a
Dear all,

I have a servlet problem.

When I modified my java servlet program and then uploaded it to my web
hosting server, then I start my web browser(I.E) to see the result.
But it loaded the previous java servlet class program. After several
days, these new classes file can be refreshed on browser.

I want to know how I can make sure I always see the most update
servlet program.

Please help.

Thank you very much.
Alan
Jul 17 '05 #1
Share this Question
Share on Google+
6 Replies


P: n/a

"alan" <ch***********@i-cable.com> wrote in message
news:7b*************************@posting.google.co m...
Dear all,

I have a servlet problem.

When I modified my java servlet program and then uploaded it to my web
hosting server, then I start my web browser(I.E) to see the result.
But it loaded the previous java servlet class program. After several
days, these new classes file can be refreshed on browser.

I want to know how I can make sure I always see the most update
servlet program.

Please help.

Thank you very much.
Alan


You should set some HTTP headers in the response to inform browser/proxies
they should not cache your output. Headers I would suggest:

Pragma: no-cache
Cache-Control: no-store
Expires: 0

These will probably solve your problem.

Regards,

Silvio Bierman
Jul 17 '05 #2

P: n/a
> You should set some HTTP headers in the response to inform browser/proxies
they should not cache your output. Headers I would suggest:

Pragma: no-cache
Cache-Control: no-store
Expires: 0


Also, if you are using MSIE then try:
tools->internet options -> General -> settings
and check 'Every visit to page'.

Regards - Jesper
Jul 17 '05 #3

P: n/a
> When I modified my java servlet program and then uploaded it to my web
hosting server, then I start my web browser(I.E) to see the result.
But it loaded the previous java servlet class program. After several
days, these new classes file can be refreshed on browser.


Every time you modify a servlet you'd better restart the Servlet Container
(Tomcat or others...).
Hope this is the final fix!

Luca Paganelli
Jul 17 '05 #4

P: n/a
Hi Alan,

This can be really infuriating, when viewing from IE try holding down shift
and F5 to refresh.

Hope this helps
"alan" <ch***********@i-cable.com> wrote in message
news:7b*************************@posting.google.co m...
Dear all,

I have a servlet problem.

When I modified my java servlet program and then uploaded it to my web
hosting server, then I start my web browser(I.E) to see the result.
But it loaded the previous java servlet class program. After several
days, these new classes file can be refreshed on browser.

I want to know how I can make sure I always see the most update
servlet program.

Please help.

Thank you very much.
Alan

Jul 17 '05 #5

P: n/a
Luca is right, your hosting company is probably running Tomcat, and if it's
an older version (<4.1) you will have to restart the servlet container
every time you make a change to a class or a jar file. I had the same
situation with a hosting company and finally decided to lease my own server
instead of calling them up 10x a week to restart the servlet container.

Good luck

"Luca Paganelli" <lu*******@TOGLILOlibero.it> wrote in message
news:WE*******************@tornado.fastwebnet.it.. .
When I modified my java servlet program and then uploaded it to my web
hosting server, then I start my web browser(I.E) to see the result.
But it loaded the previous java servlet class program. After several
days, these new classes file can be refreshed on browser.


Every time you modify a servlet you'd better restart the Servlet Container
(Tomcat or others...).
Hope this is the final fix!

Luca Paganelli

Jul 17 '05 #6

P: n/a
Dear all,

Thank you for your kindly help.

I tried set the head as non-cached. But it doesn't work.
I don't know what I am wrong.
I just want to refresh my java servlet program when it is modified and
uploaded to web server (say "Tomcat").
It is not allowed me to reload the webserver, so I need this function
to force client browser to get the latest java servlet program.

Can anybody provide me some simple examples (such as "hello world"
example)?

Thank you very much.
Best regards,
Alan
"JimTheJellyfish" <j_*******@hotmail.com> wrote in message news:<3f***********************@lovejoy.zen.co.uk> ...
Hi Alan,

This can be really infuriating, when viewing from IE try holding down shift
and F5 to refresh.

Hope this helps
"alan" <ch***********@i-cable.com> wrote in message
news:7b*************************@posting.google.co m...
Dear all,

I have a servlet problem.

When I modified my java servlet program and then uploaded it to my web
hosting server, then I start my web browser(I.E) to see the result.
But it loaded the previous java servlet class program. After several
days, these new classes file can be refreshed on browser.

I want to know how I can make sure I always see the most update
servlet program.

Please help.

Thank you very much.
Alan

Jul 17 '05 #7

This discussion thread is closed

Replies have been disabled for this discussion.