#: Johan Compagner changed the world a bit at a time by saying on 10/26/2005
10:54 AM :#
I am not a spring expert/user so i am a bit curious when is it all injected?
for example if i do this:
setResponsePage(new UserPage(user));
and that userpage has some spring beans that also must be instantiated?
And then that userpage is serialized how do you inject those beans again?
Did you overwrite the readObject() ??
johan
As Stefan explained I guess he is doing a little AOP to inject dependencies:
something like:
after(UserPage page) returning(): call(UserPage.new(..)) && target(page) {
// wire dependencies here
}
Also he said he solved the serialization problem. I assume that the above piece of advice may work
the same way against a deserialization.
I haven't seen his code yet (I am waiting for it), but this is what I am imagining from watching the
thread.
hth,
./alex
--
.w( the_mindstorm )p.
On 10/25/05, Stefan Arentz <[EMAIL PROTECTED]> wrote:
On Oct 25, 2005, at 10:48 PM, Alexandru Popescu wrote:
> #: Stefan Arentz changed the world a bit at a time by saying on
> 10/25/2005 9:32 PM :#
>
>> On Oct 25, 2005, at 10:23 PM, Alexandru Popescu wrote:
>>
>>> Stefan I was wondering why annotating the field? At the first
>>> glance it looks the logical choice, but imo the page is the
>>> object depending on the service (so the annotation should be on
>>> type level).
>>>
>> What do you mean with type level? The HelloWorldPage?
>> S.
>>
>
> yep :-). isn't this the way you name an annotations at a `class´
> level? (java.lang.annotation.ElementType.TYPE)
Yup. But I don't see how this would work. How would you specify this
one for example:
<bean name="blueImageRenderer" class="ImageRendererImpl">
<property name="color" value="blue"/>
</bean>
<bean name="yellowImageRenderer" class="ImageRendererImpl">
<property name="color" value="yellow"/>
</bean>
public class FooPage extends WebPage
{
@SpringBeanReference("blueImageRenderer")
transient private ImageRenderer blueImageRenderer;
public setBlueImageRenderer(ImageRenderer blueImageRenderer) {
this. blueImageRenderer = blueImageRenderer;
}
@SpringBeanReference("yellowImageRenderer")
transient private ImageRenderer yellowImageRenderer;
public setYellowImageRenderer(ImageRenderer yellowImageRenderer) {
this. yellowImageRenderer = yellowImageRenderer;
}
}
I know it is a silly example :-)
I'm not sure how you would do this on the class level. The annotation
there then would have to get both bean name and property names in an
array of pair. Makes no sense to me.
S.
-------------------------------------------------------
This SF.Net email is sponsored by the JBoss Inc.
Get Certified Today * Register for a JBoss Training Course
Free Certification Exam for All Training Attendees Through End of 2005
Visit http://www.jboss.com/services/certification for more information
_______________________________________________
Wicket-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-user
-------------------------------------------------------
This SF.Net email is sponsored by the JBoss Inc.
Get Certified Today * Register for a JBoss Training Course
Free Certification Exam for All Training Attendees Through End of 2005
Visit http://www.jboss.com/services/certification for more information
_______________________________________________
Wicket-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-user