It works and I don't see any inherent dangers, but is there any reason
why you can't use the @SpringBean annotation, which makes the spring
reference a proxy rather than a transient field? It is quite easy to
forget to add 'transient' to the field :)

Martijn

On 7/9/07, Tom Desmet <[EMAIL PROTECTED]> wrote:
>
> Hi all,
>
> I have a question on using wicket with the spring injector.
> I would like to create extra-lightweight webpages, and this means that
> I don't want to serialize all page dependencies (dao's and business objects
> that are member variables of the pages).
>
> I want all dao's and business objects to be injected when they are required
> on the page.
> So the injector supplies all necessary objects to the page on page
> construction. All dao's and business objects are transient, so that they are
> not serialized when a page gets stored in the pagemap.
>
> When a webpage gets deserialized by using the browsers back button, these
> transient
> fields are (evidently) null. So I would like to re-attach all the
> requirements that the page needs.
>
> I found out that this can be achieved by invoking the injector in the
> "onAttach" method of the webpage.
>
> "InjectorHolder.getInjector().inject(this);"
>
> Is this a good practice, or are there objections on doing this?
> Any help of all you guys is very much appreciated! Thanks in advance for any
> replies.
>
>
>
>
> --
> View this message in context: 
> http://www.nabble.com/Detaching-your-spring-dao%27s---business-objects-from-webpage-tf4048133.html#a11498533
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by DB2 Express
> Download DB2 Express C - the FREE version of DB2 express and take
> control of your XML. No limits. Just data. Click to get it now.
> http://sourceforge.net/powerbar/db2/
> _______________________________________________
> Wicket-user mailing list
> Wicket-user@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/wicket-user
>


-- 
Wicket joins the Apache Software Foundation as Apache Wicket
Apache Wicket 1.3.0-beta2 is released
Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.0-beta2/

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to