Hi everyone,
I'm developing an app in Struts, that needs to connect to a Domino database. For this purpose I wrote a dominoRetriever class, which is naturally a part of my model. It's a singleton, which is used by everything that needs it.
The parameters it needs (like host ip, server name, etc) are [highlight]hard coded[/highlight], which is why I'm writing to you. I'd like to place these parameters somewhere else (like web.xml), so they can be edited without desturbing the code.
So my wish comes to this:
When I start the app, I want DominoRetriever object to be created with parameters fetched from "somewhere".
I don't know how to order the instantiation of this class, on startup.
In a normal HttpServlet I'd say:
...and then I'd instantiate the class, like:
and then I'd leave this servlet and never come back.
But in Struts I can't touch the Controller, can I? (And I certanly have to come back.)
Many thanx,
p
I'm developing an app in Struts, that needs to connect to a Domino database. For this purpose I wrote a dominoRetriever class, which is naturally a part of my model. It's a singleton, which is used by everything that needs it.
The parameters it needs (like host ip, server name, etc) are [highlight]hard coded[/highlight], which is why I'm writing to you. I'd like to place these parameters somewhere else (like web.xml), so they can be edited without desturbing the code.
So my wish comes to this:
When I start the app, I want DominoRetriever object to be created with parameters fetched from "somewhere".
I don't know how to order the instantiation of this class, on startup.
In a normal HttpServlet I'd say:
Code:
String server = getServletContext().getInitParameter("serverName");
Code:
DominoRetriever = new DominoRetriever(server);
and then I'd leave this servlet and never come back.
But in Struts I can't touch the Controller, can I? (And I certanly have to come back.)
Many thanx,
p