How to access the Struts Connection Pool from an ActionForm
Steven Citron-Pousty <[email protected]> Tue, 19 Nov 2002 17:01:41 -0500
| Newsgroups | gmane.comp.web.mvc.devel |
|---|---|
| Organization | Basebeans.com |
| Message-ID | <[email protected]> |
Greetings all:I am trying to populate the options for a select list from a DB call. And I am getting a null pointer exception from this line in the ActionForm:To: [email protected] DataSource dataSource = (DataSource) servlet.getServletContext().getAttribute(Action.DATA_SOURCE_KEY);To: [email protected] What I am trying to do is use the ConnectionPool provided by Struts. This call works great in my Action but doesn't work in my ActionForm.On the IRC channel (irc.freenode.net #struts) we have been discussing the merits of putting a DB call in an ActionForm.To: [email protected] SOoo, my main question is,How do I ask the context for the connection pool in an ActionForm?To: [email protected] But I would also love to see discussion about the merits of putting a DB call in an ActionForm at all. If I didn't put the call in the ActionForm how would I get the data from the DB call into the actionForm?To: [email protected] Thanks in advance for all your help,SteveTo: [email protected] _______________________________________________ MVC-Programmers mailing list [email protected] http://www.netbean.net/mailman/listinfo/mvc-programmers ------------------------ Yahoo! Groups Sponsor ---------------------~--> Share the magic of Harry Potter with Yahoo! Messenger http://us.click.yahoo.com/4Q_cgB/JmBFAA/46VHAA/NhFolB/TM ---------------------------------------------------------------------~-> To unsubscribe from this group, send an email to: [email protected] Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/