October 23rd, 2002, 07:23 AM
Include file not changing
This is a simple problem that crops up every so often and i'm never sure how to rectify it.
I have a jsp page (page1) with a jsp include file (page2). When I change the include file and save it I expect to see the changes reflected in page1 when I reload it, however this doesn't always happen.
I stop and start tomcat, delete my work folder, reboot, stamp my feet and sometimes it cures it but not today. What am I doing wrong?
October 23rd, 2002, 10:58 AM
Thats great, thanks. Will it have any effect on the speed of the app?
October 23rd, 2002, 11:15 AM
Sorry about that, I left my computer unattended for a second and someone thought it would be funny to delete my reply
You will lose a little speed because you are compiling at runtime, but I don't think that it will be significant.
Also, have tried compiling the individual include files before trying to view through the main jsp file??
October 23rd, 2002, 11:21 AM
how would I compile them? I only compile my class files, I save my jsp files, am I missing something...
October 23rd, 2002, 12:29 PM
Sorry I should of been clearer. JSP files are compiled once, the first time you view the page. So what I was trying to say is, try viewing the individual jsp pages you have changed, before viewing them within the main page.
October 23rd, 2002, 12:39 PM
thanks a lot for your help, I'll try that.
October 23rd, 2002, 09:10 PM
the changes in the includes will only be reflected in the overall page if the file that is doing the including changes too.
so, to come back to your initial example, if you edit "page2" and resave it, also resave "page1" (some editors make this a hassle - i've been using dreamweaver mx recently, and i can just a space/char and then remove it again, and it'll allow me to re-save). that way, your app server sees that "page1" has changed and recompiles it - giving you the changes you made in "page2" in the final page.
Little more than a playground for the bugs that live beneath us...
October 24th, 2002, 12:06 PM
What application server are you using? I know Tomcat 4.x can be setup to reload .class files when they are recompiled (I'd assume it would catch included jsps as well).
October 25th, 2002, 04:05 AM
thats interesting, tomcat 4.04
October 25th, 2002, 11:19 AM
There's a reloadable attribute in the context tag in your server.xml file. Make sure it's set to "true". If it's *already* true, well, then I guess you're stuck .