Re: using struts datasource from a servlet

2003-07-01 Thread Erik Price
Richard Raquepo wrote: Another option would be to configure the DS in struts but register it with a singleton (Service Locator) that can retrieve the datasource in your data access classes. maybe you can give me some link about this? tutorials maybe? any code maybe? :p As you wish:

RE: using struts datasource from a servlet

2003-06-30 Thread Steve Raeburn
Struts stores the datasources as servlet context attributes. You can access the default datasource in your servlet using - (DataSource) getServletContext().getAttribute(Globals.DATA_SOURCE_KEY); Take a look at the struts-config dtd for more info (particularly if you use modules)

Re: using struts datasource from a servlet

2003-06-30 Thread Richard Raquepo
Users Mailing List [EMAIL PROTECTED] Sent: Monday, June 30, 2003 2:34 PM Subject: RE: using struts datasource from a servlet Struts stores the datasources as servlet context attributes. You can access the default datasource in your servlet using - (DataSource) getServletContext().getAttribute

RE : using struts datasource from a servlet

2003-06-30 Thread Nicolas Seinlet
Subject: RE: using struts datasource from a servlet Struts stores the datasources as servlet context attributes. You can access the default datasource in your servlet using - (DataSource) getServletContext().getAttribute(Globals.DATA_SOURCE_KEY); Take a look at the struts-config dtd

RE: using struts datasource from a servlet

2003-06-30 Thread Steve Raeburn
; [EMAIL PROTECTED] Subject: Re: using struts datasource from a servlet ic... another question. what if it's not a servlet. just a class i made wherein i call it from one of my action or servlet but still i will need to use struts datasource. how can it be done. thanks everyone. -richard

Re: using struts datasource from a servlet

2003-06-30 Thread Richard Raquepo
- From: Steve Raeburn [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Monday, June 30, 2003 3:20 PM Subject: RE: using struts datasource from a servlet You can either pass the datasource from your servlet/action as a method parameter or you need to register the datasource