You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Dale Newfield <Da...@Newfield.org> on 2007/11/06 17:11:57 UTC

Re: [struts] jsp pages cahces on struts

Odelya Glick wrote:
> I deleted the files under:
> TOMCAT_HOME\work\Cataline\localhost\myProjectName
> 
> But is there a better way to never cache it?

.jsp gets converted to .java which then gets compiled to a .class, which 
is then loaded and executed.  You do *not* want to go through that 
process for every single .jsp render.

Probably the reason you had caching problems is that in one of your 
changes you broke the .jsp, so it was unable to create a (new, valid) 
.java file (so a new .class was not generated, didn't replace the 
previous one, and you were left with the previous page).  Look in your 
logs for the .jsp compile error.

-Dale

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: [struts] jsp pages cahces on struts

Posted by Wes Wannemacher <we...@wantii.com>.
I actually ran into this once where the JSP was not being updated, and
the issue was that for some reason (incorrect time on my workstation
or something), the timestamp on the JSP file was older than the
timestamp of the compiled JSP. Usually when the JSP is broken, Tomcat
will recognize that it won't compile and serve an error (500 with
compile error), but I have had it happen that Jasper doesn't realize
the JSP is bad and serves up the old content.

If this is a consistent behavior in your environment, I would say that
there is probably some obscure problem that you should track down and
fix before creating a workaround that will undoubtedly cost you more
time than necessary.

(As an aside, I noticed that when using Tomcat in eclipse-wtp, you can
right-click the Tomcat server and choose 'Clean...' which will dump
the work folders and recompile all JSPs. One of those
should-not-be-necessary-but-glad-you-did-it type of things).

On 11/6/07, Dale Newfield <Da...@newfield.org> wrote:
> Odelya Glick wrote:
> > I deleted the files under:
> > TOMCAT_HOME\work\Cataline\localhost\myProjectName
> >
> > But is there a better way to never cache it?
>
> .jsp gets converted to .java which then gets compiled to a .class, which
> is then loaded and executed.  You do *not* want to go through that
> process for every single .jsp render.
>
> Probably the reason you had caching problems is that in one of your
> changes you broke the .jsp, so it was unable to create a (new, valid)
> .java file (so a new .class was not generated, didn't replace the
> previous one, and you were left with the previous page).  Look in your
> logs for the .jsp compile error.
>
> -Dale
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>


-- 
Wesley Wannemacher
President, Head Engineer/Consultant
WanTii, Inc.
http://www.wantii.com

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org