Hi,
>Let's assume that the Hashxxx you use to store your list of
>request URIs is
>stored as an attribute of your servlet context. Then:
>
> HashTable uriList = (HashTable)
>servlet.getServletContext().getAttribute("urilist");
>
>Since you can get & set attributes this way into your servlet context (and
>the servlet we are talking about here is your controller servlet),
>then you
>could easily write an action class that reloads this object from your xml
>configuration file; thus achieving dynamic reloading. Naturally, the uri
>used to do this (ReloadConfig.do) would be part of your admin area with
>security restrictions....
>
>Just a thought,
A good one indeed.
Interesting too. My worry is..what if you do it during the day? Two
scenarios come to mind..I am sure there are more. One is..you add a new
action, and add the <action..> tags to the xml config file. Through your
admin .do action, you reload the xml file, like you said..using the servlet
context to store the Hashset (Sorry..set for me. ;). I agree with Craig
too..in passing the THIS as the Servlet to pass on to every action. This is
what makes your Admin possible..passing the servlet to gain access to the
context. So, in Scenario #1, you would simply reload the xml file, and it
would just "add" the new actions..and they should be ready to be used even
while your server is running during the day. The only thing to worry about
is somehow making sure requests don't come in during the process of
replacing the Hashset config information..thus it might be more plausible to
use a Hashtable for this?
Scenario #2 is you modify an existing action. This might mean the .java
source, or you may change an existing action to point to a new action class.
The problem in my mind is how do you do this while users are using your
actions at the same moment? You don't want to lose their session
information, or have them submit a request while the server is
"re-initializing", or they may end up seeing some nasty error messages, and
lose their info too. So what is the course of action to reload modified and
new actions (classes, xml config, etc) while maintaining current sessions?
Thanks.
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html
http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets