You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "struts (H2Opilot)" <st...@h2opilot.de> on 2001/09/12 10:13:46 UTC
Initalizing at startup and make global usable
Hi all,
I have to use an Array with my menuestructur global in my strutsapplication.
Therefor I implement an Class DynamicBean which initalizes the Array and
fills them all up by parsing an config file.
Up to now I put this call at any *.jsp-page. This is quite slow, because he
always should read the full config file and parse it for any jsp.
Here is my code example:
<% h2ouapp.DynamicBean menu= new h2ouapp.DynamicBean();%>
The constructor of this Class is then initalizing the array..
I then use this Array via the following call to produce the menue:
<% out.println(menu.moschreib());%>
So, how can I start the initalizing via startup of struts...
Should I use web.xml?
How can I make the array global accessible and can I then use it?
Can anybody give me a code example?