restarting tomcat??

hi, I would like to know if there is a way to refresh included files in a jsp without restarting Tomcat. This is a problem for me because 1) I don't want to wipe out all the active sessions on the server 2) When I do restart Tomcat, it doesn't always pick up on the changes in the include file; it keeps using the older versions. Does anyone know why this is?? Thanks very much -Zman

You are not being very specific on what are you trying to accomplish. More details would be much more helpful for everyone in order to give you more answers. m, phx

scottie zman
Ranch Hand

Joined: Aug 08, 2001
Posts: 40

posted Aug 24, 2001 11:20:00

0

Yea I guess it was kind of abiguous. I'm new to JSP and I'm basically trying to accomplish some similar results (to start with, anyway) as what I'm able to get with asp. The thing about includes in JSP is that once you compile the page it doesn't check to see if the included file ever changes. Since the posting of my last message, I've learned about using dynamic includes, which are a bit better, but those don't have any session scope other than explicit parameters sent to it. And it doesn't seem that I could pass any objects or result sets or xml to a dynamically included file (please correct me if I'm wrong) Basically, what I'm trying to accomplish is... to have a chunk of code -- jsp/html that is within the scope of the page/session that I can include into a jsp, and update at any time without restarting the server. I'm still wrapping my head around tag libraries- can this be accomplished with them? or do I just have to write a bean that produces the html? that seems like it would be a bad idea. I'm sure there's a way of doing this... thanks Zman

The included resource has the request/response object of the including resource. Also you can pass in other parameters, but as far as i know, they can only be name/value string parameters.

Check this post out (my posts are at the bottom) http://www.javaranch.com/ubb/Forum7/HTML/004785.html the part that would interest you is in my last post, where I (painfully) describe that something that is statically included can still contain dynamic content. Or.. you can dynamically include both static and dynamic content.

However, the catch being... is your servlet runner smart enough to know that when jasper (the JSP compiler) is going out to fetch the jsp to be 'dynamically included'... will it check to see if THIS resource needs to be recompiled? In other words, do you need to access the included resource individually to enable the servlet runner's 'smart' checking of "has this changed or not". I would hope it would do the dynamic include properly (ie: if you change the included file, it would pick up those changes), but I admit I've never tried it.

Hope that helped. [This message has been edited by Mike Curwen (edited August 25, 2001).]