RE: How to initialize business service objects?

2008-03-19 Thread Frank Fischer
Hi Dave Hi all Finally i got it working the "spring"-way, meaning, when also delegating the instantiation of action classes to spring. The "default" way, meaning letting struts2 creating the action instances still doesn't work and i really don't understand why. Thanks to everyone that help me get

RE: How to initialize business service objects?

2008-03-17 Thread Griffith, Michael *
] Sent: Monday, March 17, 2008 1:35 PM To: 'Struts Users Mailing List' Subject: RE: How to initialize business service objects? Hi Michael Thanks for your answer. > 1) You have included the struts2-spring-pliugin.jar in your classpath Yes, it put it under "WEB-INF/lib/" so i

RE: How to initialize business service objects?

2008-03-17 Thread Dave Newton
--- Frank Fischer <[EMAIL PROTECTED]> wrote: > Off the top of my head I don't recall what "autodetect" means. Did you try leaving out the "default-autowire" attribute or switching it to the default ("name" or something like that; I don't recall) and seeing if that works? That would at least hel

RE: How to initialize business service objects?

2008-03-17 Thread Frank Fischer
Hi Michael Thanks for your answer. > 1) You have included the struts2-spring-pliugin.jar in your classpath Yes, it put it under "WEB-INF/lib/" so it's packaged to the war file and should be available to tomcat it think. I also can't see any error or warning messages while deploying the applicati

Re: How to initialize business service objects?

2008-03-17 Thread Dave Newton
--- Randy Burgess <[EMAIL PROTECTED]> wrote: > You also need to setup your action in the application context so that > Spring knows where to inject the business object. You *can* do it that way, but the default setup doesn't require it. It depends on how you're wiring, whether or not your philoso

Re: How to initialize business service objects?

2008-03-17 Thread Rushikesh Thakkar
Frank, AFAIU, you want your Business Service Object to be injected in your Struts2 actions. To achieve that, I have done this: - Using Spring ObjectFactory. - Declare Business Service Object (BSO) in Spring's applicationContext.xml(you've already done that) - Define action that has setter method

Re: How to initialize business service objects?

2008-03-17 Thread Randy Burgess
mmunications > From: Frank Fischer <[EMAIL PROTECTED]> > Reply-To: Struts Users Mailing List > Date: Mon, 17 Mar 2008 17:08:30 +0100 > To: 'Struts Users Mailing List' > Subject: RE: How to initialize business service objects? > > > Hi all > >

Re: How to initialize business service objects?

2008-03-17 Thread Piero Sartini
Am Donnerstag, 13. März 2008 22:32:34 schrieb Frank Fischer: > Now i don't understand (1) where to create/initialize these business logic > classes and (2) how to get access to them from the action classes. Just build your business logic without thinking about s2 too much. From your action classe

RE: How to initialize business service objects?

2008-03-17 Thread Griffith, Michael *
ation classpath*:applicationContext*.xml HTH, MG -Original Message- From: Frank Fischer [mailto:[EMAIL PROTECTED] Sent: Monday, March 17, 2008 11:09 AM To: 'Struts Users Mailing List' Subject: RE: How to initialize business service objects? Hi all first i&

RE: How to initialize business service objects?

2008-03-17 Thread Frank Fischer
Hi all first i'd like to thank all of you that have given me valuable feedback to my question. Following the answers from Dave and Jeromy i decided to go the "hard" way with Spring and DI. After reading some manuals (thanks to GF, good reading) i managed to load the Spring ContextLoaderListene

Re: How to initialize business service objects?

2008-03-17 Thread GF
I suggest you to read this simple but useful tutorial to have an idea about how much is simple to use Struts2+Spring+Hibernate together. http://struts.apache.org/2.x/docs/struts-2-spring-2-jpa-ajax.html On Thu, Mar 13, 2008 at 10:32 PM, Frank Fischer < [EMAIL PROTECTED]> wrote: > > Now i don't u

Re: How to initialize business service objects?

2008-03-13 Thread Jeromy Evans
Hi Frank, Have a read of Martin Fowler's article on deciding which option best suits you: http://martinfowler.com/articles/injection.html As Dave described you have many possibilities, but the common techniques are (not in order of preference): a. Use a ServletContextListener to to setup you

[OT] RE: How to initialize business service objects?

2008-03-13 Thread Dave Newton
--- Frank Fischer <[EMAIL PROTECTED]> wrote: > I just read a bit regarding Spring. As far as i understand its focus is on > J2EE appllications. I guess for what i want to do in a first step (my > simple chat app) it would be overkill to use Spring. Do i get that right? Not really. IMO Spring is a

RE: How to initialize business service objects?

2008-03-13 Thread Frank Fischer
. Can you help me to get on track again? Thanks for your help Frank > -Original Message- > From: Randy Burgess [mailto:[EMAIL PROTECTED] > Sent: Thursday, March 13, 2008 11:02 PM > To: Struts Users Mailing List > Subject: Re: How to initialize business service o

Re: How to initialize business service objects?

2008-03-13 Thread Randy Burgess
For a POJO you can use dependency injection such as Spring or Guice or you can instantiate the object the normal way BusinessServiceObject bso = new BusinessServiceObject(); in your action class. There is nothing special about accessing your BSO's in Struts. Regards, Randy Burgess Sr. Web Applic