On Tue, 6 Jun 2000, Ritesh Sinha wrote:
> Hi Preston,
> Can you suggest me a server that automatically reloads Servlets. Actually I
> am Working on JSP and I have used, JRun, Tomcat, JSWDK none of them do
> this.
> It will be great help if you could suggest any server that automatically
> reloads.
> Other wise the only solution is to *Restart* your server, if not the whole
> server then at least the Servlet/JSP engine whtever you are using. I am
> surprised, becoz, conceptually , just a little check on the creation time
> of the class file will solve this problem and it has never been
> Incorporatedin any of these
AFAIK, *all* of the servlet containers you mention above except for
JSWDK (which is a dead end project) do do automatic servlet reloading
(and most others do as well). So, likely you are doing something
wrong. Perhaps the most common thing people do wrong to screw up
servlet reloading is putting the servlets on the classpath -- they
should be in the designated servlets directory and *not* on the
classpath. For further details/other possible problems, you'll
probably need to refer to the specific servlet container.
> And again I am not sure how does the Browser store a servlet in Cache? What
> it sees is the HTML out put of the Servlet and not any HTML file.
> I hope I am correct in my concepts.
> If i am wrong please correct me as I am very new to these fields.
> Just my 2c worth, :-)
I thought I saw someone explain that browsers do not store servlets,
in fact, they do not even know that/whether a servlet was used on the
server side. That is in fact correct. To the browser, it's just some
data with some headers indicating what to do with it -- e.g. that it's
HTML, that it's plain text, that it's binary. Some of those headers
affect whether the browser caches the results or goes back to the
server the next time it needs that URL. I suggest you read the
archives of this list for more information on that.
> "Preston L. Bannister" <[EMAIL PROTECTED]> on 06/06/2000 07:30:36 PM
>
> Please respond to "A mailing list for discussion about Sun Microsystem's
> Java Servlet API Technology."
> <[EMAIL PROTECTED]>
>
> To: [EMAIL PROTECTED]
> cc: (bcc: Sinha Ritesh-SWD-ITIL-UB/Itilmail)
>
> Subject: Re: Cache problem
>
>
>
>
> From: Siva Sankara Reddy
> > When i am invoking a servlet, the browser is gettting the old one from
> > cache. How can i prevent this.
>
> Just to be clear:
>
> The browser isn't getting the *servlet* since all your browser sees is
> HTML pages, which may in turn have been generated on the server-side
> by a servlet.
>
> If the browser is getting the page from it's local cache, rather than
> calling the server, that's one possible problem. If the browser is
> getting the page from your ISP's HTTP proxy, that's another possible
> problem. In either case you need to read up on cache control:
>
> http://www.mnot.net/cache_docs/
>
> The above is the first question you need to answer...
>
> If you can determine that the request is in fact making it back to
> the server, and you are getting an "old" response, then that would
> be a different problem. In this case you have presumably updated
> the servlet (likely in a ./servlets directory) on the web server
> but are still seeing responses from the old logic.
>
> You have a couple choices.
>
> You could restart the web server entirely. If this works and new
> requests return responses from the new servlet, then you at least
> know that you are putting your new servlet in more or less the
> right place.
>
> I say "more or less" because most servlet engines will automatically
> reload servlets when the servlet .class file changes on disk.
>
> So you shouldn't have to restart your web server to get the new
> servlet invoked. If your servlet is *not* getting reloaded, then
> you need to dig into the configuration of your servlet engine
> (whichever one that is).
>
>
> [ Am I mistaken, or have the quality of answers taken a dive?? ]
>
> From: Manish Bhatnagar
> > Whe you compile your servlet... put the class files in
> <server_root>/classes
> > and <server_root>/servlets... and remember to terminate the Web server
> before
> > firing your browser... You can do that by pressing Crtl+C and then...
> press
> > Ctrl+Alt+Del... and say 'End Task' to Jrew service (All this holdes good
> if you
> > are using Java Web Server 2.0).
>
> From: Ch.Srinivas Kumar
> > if u r using Apache web server(3.0) go to the admin servlet .there u
> have
> > option called "Server Side Include(SSI)" uder this there is an option
> "File
> > cache" click on it.by default this is enabled and the cache size is
> 100k,now
> > disable this and ur problem will be solved.let me know if it is
> solved.Bye.
>
> From: Ritesh Sinha
> > The solution is to restart your server. The servlet remains in the memory
> > of the webserver. It is flushed when you restart it.
>
> I was going to respond to these individually,
> but don't have *that* much time :).
>
> --
> Preston L. Bannister
> [EMAIL PROTECTED]
> http://members.home.com/preston
> pbannister via Yahoo! Messenger
>
> ___________________________________________________________________________
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
> of the message "signoff SERVLET-INTEREST".
>
> Archives: http://archives.java.sun.com/archives/servlet-interest.html
> Resources: http://java.sun.com/products/servlet/external-resources.html
> LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
>
> ___________________________________________________________________________
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
> of the message "signoff SERVLET-INTEREST".
>
> Archives: http://archives.java.sun.com/archives/servlet-interest.html
> Resources: http://java.sun.com/products/servlet/external-resources.html
> LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
>
Milt Epstein
Research Programmer
Software/Systems Development Group
Computing and Communications Services Office (CCSO)
University of Illinois at Urbana-Champaign (UIUC)
[EMAIL PROTECTED]
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html