struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Günther Wieser <>
Subject AW: Need Help Passing Data Values To My subclass Action class
Date Tue, 01 Mar 2005 16:23:30 GMT
use request.getSession().getServletContext() in the action class to receive
the context of the struts action servlet, and you can use the action class
to set a property of the action form as you would do it if you want to
prepopulate form data (a good example is described in using
two action classes, one for prepopulating the action form and one for the
actual "doing").
also you could implement a class that gets initialized during loading of a
webapp (e.g. implementing ServletContextListener ) and gets all data from
servlet context into a hashmap, and have a static method that retrieves the
data from this hash map.


-----Ursprüngliche Nachricht-----
Von: Scott Purcell [] 
Gesendet: Dienstag, 01. März 2005 17:09
Betreff: Need Help Passing Data Values To My subclass Action class

I am trying to pass a value that is configured in my web.xml which is my
"databaseID" that I need in my Action class.
I have asked prior, but received no help, so I am trying again. If I have a
value in the deployment file that I can get out using a ServletContext, how
can I get that into a subclass of an Action class, or even to a ActionForm
subclass, since neither extend the HttpServlet class?
I would appreciate any input,

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message