Re: T5: ASO in HttpServletRequestFilter

2008-05-13 Thread Kristian Marinkovic
t;Tapestry users" Kopie Thema Re: T5: ASO in HttpServletRequestFilter Obvious: Because you can't access the HttpServletRequest from within the RequestFilter to access methods such as getRequestUri() (needed by 3rd party library being called in the filter). If I didn't have

Re: T5: ASO in HttpServletRequestFilter

2008-05-13 Thread kranga
From: "Robert Zeigler" <[EMAIL PROTECTED]> To: "Tapestry users" Sent: Tuesday, May 13, 2008 10:43 AM Subject: Re: T5: ASO in HttpServletRequestFilter Why not use a RequestFilter, instead? You can access the ApplicationStateManager from withing a RequestFilter. Robert On

Re: T5: ASO in HttpServletRequestFilter

2008-05-13 Thread Robert Zeigler
Why not use a RequestFilter, instead? You can access the ApplicationStateManager from withing a RequestFilter. Robert On May 13, 2008, at 5/139:41 AM , kranga wrote: Version: 5.0.11 It appears that if you inject an application state manager into an HttpServletRequestFilter and try to access

Re: T5 ASO cannot have a non default constructor in 5.0.11?

2008-05-11 Thread Martin Grotzke
On Sun, 2008-05-11 at 16:15 +0200, Filip S. Adamsen wrote: > You can still use an ApplicationStateCreator. Just instantiate the ASO > in the creator and set the values wherever you want after its creation. Ha, you're right, I simply want to invoke the default constructor - I forgot this ;) Thanx

Re: T5 ASO cannot have a non default constructor in 5.0.11?

2008-05-11 Thread Filip S. Adamsen
You can still use an ApplicationStateCreator. Just instantiate the ASO in the creator and set the values wherever you want after its creation. -Filip On 2008-05-11 16:12, Martin Grotzke wrote: On Sun, 2008-05-11 at 15:13 +0200, Filip S. Adamsen wrote: Hi, Tapestry is trying to inject service

Re: T5 ASO cannot have a non default constructor in 5.0.11?

2008-05-11 Thread Martin Grotzke
On Sun, 2008-05-11 at 15:13 +0200, Filip S. Adamsen wrote: > Hi, > > Tapestry is trying to inject services into your ASO's constructor. In > 5.0.12-SNAPSHOT you can put @Inject on the constructor Tapestry should > use when auto-instantiating. Ok, thanx! This will solve our issue when we can upgr

Re: T5 ASO cannot have a non default constructor in 5.0.11?

2008-05-11 Thread Filip S. Adamsen
Hi, Tapestry is trying to inject services into your ASO's constructor. In 5.0.12-SNAPSHOT you can put @Inject on the constructor Tapestry should use when auto-instantiating. Until you can upgrade to 5.0.12 I guess a workaround would be to contribute and ApplicationStateCreator for your ASO.

Re: T5 ASO & Service

2008-05-09 Thread maxthesecond
Well I just wandered about serialization issues, but better for me if it's not a problem, at the end I added my Service as a parametrer in the ASO: MyASO.addproducttoChart(idProduct,MyServices) { Map _chartMap; Product p=MyServices.getProductById(idProduct); _chartMap.put(idProduc

Re: T5 ASO & Service

2008-05-09 Thread Filip S. Adamsen
What? It's not uncommon to have methods on an ASO. You can also inject services into it when creating it if you use an ApplicationStateCreator. The relevant docs on Application State has an example at the bottom. -Filip maxthesecond skrev: oopss! I think I missed the point the ASO aplication

Re: T5 ASO & Service

2008-05-08 Thread maxthesecond
oopss! I think I missed the point the ASO aplication state object is merely a container for sharing information across pages and time it shall not have metods, so I'll do as you say. thanks again -- View this message in context: http://www.nabble.com/T5-ASO---Services-tp17134860p17141903.html Se

Re: T5 ASO & Service

2008-05-08 Thread maxthesecond
Sounds good, if it's simply imposible to use services within ASO I'll do that, but I found more natural the other way arround: In the Page _MyAso.addproductttoChart(id); In the ASO MyASO.addproducttoChart(idProduct) { Map _chartMap; @Inject private MyServices _MyServices; Product

Re: T5 ASO & Service

2008-05-08 Thread Bill Holloway
Of course, you'll have the went-to-null trouble even passing the bits of data into your service as method args :) On Thu, May 8, 2008 at 2:38 PM, maxthesecond <[EMAIL PROTECTED]> wrote: > > How I'm suposed to get services inside an ASO? > > I placed my DAO objects in services I didn't need any ses

Re: T5 ASO & Service

2008-05-08 Thread Bill Holloway
Max, What I do in my app is pass the relevant bits of ASO data into my service methods as arguments. You could pass the entire ASO, but you might risk having it go null on you if the ASO gets set to null somewhere. Bill On Thu, May 8, 2008 at 2:38 PM, maxthesecond <[EMAIL PROTECTED]> wrote: > >

RE: [T5] ASO, BeanEditor and Interfaces

2008-02-03 Thread Jonathan Barker
rnate retrieval. Jonathan > -Original Message- > From: Kheldar666 [mailto:[EMAIL PROTECTED] > Sent: Sunday, February 03, 2008 5:49 PM > To: users@tapestry.apache.org > Subject: RE: [T5] ASO, BeanEditor and Interfaces > > > Yes ! that was it :) > > I inde

RE: [T5] ASO, BeanEditor and Interfaces

2008-02-03 Thread Kheldar666
stry.apache.org/tapestry5/tapestry-core/guide/appstate.html > > Also, you can make sure your UserImpl constructor instantiates an empty > Address object. > > Jonathan > > >> -Original Message- >> From: Kheldar666 [mailto:[EMAIL PROTECTED] >> Sent: S

RE: [T5] ASO, BeanEditor and Interfaces

2008-02-03 Thread Jonathan Barker
stry-core/guide/appstate.html Also, you can make sure your UserImpl constructor instantiates an empty Address object. Jonathan > -Original Message- > From: Kheldar666 [mailto:[EMAIL PROTECTED] > Sent: Sunday, February 03, 2008 1:53 PM > To: users@tapestry.apache.org > Subject

Re: [T5] ASO, BeanEditor and Interfaces

2008-02-03 Thread Sven Homburg
hmmm, i try to understand, why do you mean, that the beaneditor should create or instantiate anything for ? if i not realy going wrong you must take care that any class, you want to edit, is instantiated before. and ofcourse you must feed the beaneditor with an instance not an interface 2008/2/3

Re: [T5] ASO, BeanEditor and Interfaces

2008-02-03 Thread Kheldar666
Heu... I allready have a full Hibernate/Spring instantiation system that works perfectly well :-) . I'm not trying to instanciate a Bean via Tapestry. I try to edit one that is allready loaded. The problem for me comes from Tapestry beanEditor that tries -I think- to create an empty bean using

Re: [T5] ASO, BeanEditor and Interfaces

2008-02-03 Thread Sven Homburg
i think you missunderstood completely the sense of hibernate entities and IOC serices. in your case i think it makes more sense to let instantiate the enties by a factory class please read http://www.hibernate.org/328.html 2008/2/3, Kheldar666 <[EMAIL PROTECTED]>: > > Well by adding this to my mo

Re: [T5] ASO, BeanEditor and Interfaces

2008-02-03 Thread Kheldar666
Well by adding this to my module : public static void bind(ServiceBinder binder){ binder.bind(User.class, UserImpl.class); binder.bind(Address.class, AddressImpl.class); } I solved the User instanciation problem. But It didn't solve the Address ins

Re: [T5] ASO, BeanEditor and Interfaces

2008-02-03 Thread Sven Homburg
this should help you http://wiki.apache.org/tapestry/Tapestry5HowToIocAndHibernate 2008/2/3, Kheldar666 <[EMAIL PROTECTED]>: > > Hi Everybody, > > I was wondering if ASO and BeanEditor can work with Interfaces ? At the > first sight it seems not possible. > > Let's say I have this Interface and Cl

Re: T5 - ASO cannot be in the same package as the page?

2007-03-22 Thread Stephan Schwab
Howard Lewis Ship wrote: > > By putting the ASO class into the pages package, Tapestry created an > enhanced version of the ASO class, as if it were a component. This > enhanced class is in the class loader used for pages, components and > mixins. The reference to the ASO in the page is a refer

Re: T5 - ASO cannot be in the same package as the page?

2007-03-22 Thread Howard Lewis Ship
By putting the ASO class into the pages package, Tapestry created an enhanced version of the ASO class, as if it were a component. This enhanced class is in the class loader used for pages, components and mixins. The reference to the ASO in the page is a reference to the enhanced version, not the

Re: T5 - ASO cannot be in the same package as the page?

2007-03-22 Thread Bogdan Calmac
Hi Peter, I see your point. Any class in the pages package can be accessed through an URL and it doesn't make sense to store anything else than pages there. But on the other hand, the behaviour that I reported is totally obscure and not in line with the nice error reporting of tapestry. If someb

Re: T5 - ASO cannot be in the same package as the page?

2007-03-22 Thread Anjana Gopinath
I beleive you are supposed to put only your page classes in the page folder. Refer tapestry 5 tutorial, page 19. Anjana Gopinath On Mar 22, 2007, at 10:07 AM, Bogdan Calmac wrote: After creating my own ASO object, I kept getting the ClassCastExeception below when accessing it, until

Re: T5 - ASO cannot be in the same package as the page?

2007-03-22 Thread Peter Beshai
Not 100% sure, but it seems like Tapestry has designated my.package.pagesfor Tapestry Pages (convention) and my.package.components for Tapestry Components (convention again). So Tapestry will treat the classes in those packages as pages/components respectively. It is likely a better idea anyway to

Re: T5 ASO

2007-03-21 Thread Anjana Gopinath
Thats true. My code is more clean now!! Thanks to everyone who helped me out, i am almost done with my mini project in Tapestry 5. This is the 5th day since i started it, i wouldnt have reached here without the support of this community. Thanks!!! Anjana Gopinath On Mar 21, 2007, at

Re: T5 ASO

2007-03-21 Thread Ted Steen
I like these discussions, and I really like that they tend to end in a conclusion that good code conventions and good code design seems to be the solution to the "problem". T5 encourage one to do things "right". 2007/3/20, Anjana Gopinath <[EMAIL PROTECTED]>: Thanks Robert! Anjana Gopinath Tru

Re: T5 ASO

2007-03-20 Thread Anjana Gopinath
Thanks Robert! Anjana Gopinath True North Technology 11465 John's Creek Parkway, Suite 300 Duluth, GA 30079 [EMAIL PROTECTED] On Mar 20, 2007, at 5:47 PM, Robert Zeigler wrote: Tapestry works its magic using runtime type information, and since generics in java were implemented using type

Re: T5 ASO

2007-03-20 Thread Robert Zeigler
Tapestry works its magic using runtime type information, and since generics in java were implemented using type erasure, the two types will be the same at runtime. So you'll need to wrap the two lists in some type of enclosure, just like with the pricing information. Robert On Mar 20, 200

Re: T5 ASO

2007-03-20 Thread Anjana Gopinath
Thanks Howard for explaining. It makes sense. But what if i want to store a list of objects as a ASO? For example public ArrayList appList; public ArrayList networkList; Both the above are of type List, but list of two objects. Will this be an issue? Anjana Gopinath True North Technolog

Re: T5 ASO

2007-03-20 Thread Howard Lewis Ship
T4 allowed multiple ASOs of the same type, however each and every ASO had to be defined with a unique name, plus an XML snippet to identify how to instantiate it. This violated the Dont Repeat Yourself principle, since you had to know and repeat the ASO name on every use throughout the applicatio

Re: T5 ASO

2007-03-20 Thread Anjana Gopinath
Robert Thanks for explaining and i perfectly understand your point. But i still feel this is a restriction as i cant have ASOs of same type. Anyway, right now i can continue with the way you suggested. Thanks! Anjana Gopinath True North Technology 11465 John's Creek Parkway, Suite 300 Duluth,

Re: T5 ASO

2007-03-20 Thread Robert Zeigler
I see it as simplification rather than a restriction. I guess I don't normally store application state in a bunch of separate strings; rather, I always store state in one or more POJO's, exactly analogous to the Pricing object. So, for me, less mess, because I don't have to have a bunch of e

Re: T5 ASO

2007-03-20 Thread Anjana Gopinath
Thanks Robert for responding. I can do that, but was wondering why there is a restriction like this? Anjana Gopinath True North Technology 11465 John's Creek Parkway, Suite 300 Duluth, GA 30079 [EMAIL PROTECTED] On Mar 20, 2007, at 4:29 PM, Robert Zeigler wrote: Correct. Why not create,

Re: T5 ASO

2007-03-20 Thread Robert Zeigler
Correct. Why not create, say, a "Pricing" object with "enterprisePrice" and "clientPrice" properties? Then you could do: @ApplicationState private Pricing _pricing; Then you have one less injection to do/page that requires pricing information. :) Robert On Mar 20, 2007, at 3/203:26 PM ,