RE: ThreadLocal - NO! And don't do this.... Setting the response page (with redirect) is going to send a response to the browser that tells it to redirect to the new page. Then your response is closed - meaning that the servlet container is done using that thread for that user, and will use it the next time a request comes in and it needs it. Now, if some other user browses a page, the servlet container may use that thread for them, and you will receive user A's data from the thread local for user B. Meanwhile, you have no idea what thread the request from user A ends up in when he requests the page he was redirected to.
You should not try to use thread locals in your webapp unless you really manage them VERY closely. Why not put the data on the session, or in the page / panel / etc.... that Wicket is already handling the complex stuff for? On Fri, Dec 12, 2008 at 1:17 PM, miro <[email protected]> wrote: > > Yes its the same problem I resolved it with the suggestion you pointed > aspectJ.I am using aspectJ compiler to introduce some meta information to > my pages, the only reason I donot want to have super class is the ability > to swap a class use it or not with least changes and in my case just an > annotation. > By the way If I set some an object in threadlocal in onClick method and > call > setResponsePage() and setRediret(true) will I have this object in thread > in the new page ? > > jWeekend wrote: > > > > Miro, > > > > Is this related to the CGLIB problem you were having? Did the Spring guys > > find an answer on their forum? If you did solve it, what did your fix > > entail? > > > > In terms of "introducing" stuff to your pages, given that the framework > > will never be aware and able to utilise any such introduction there seems > > to be little benefit in making introductions directly to the page; why > not > > make a base class for the pages you have in mind that can hold a > reference > > to an object which is the target of the introduction (it can be an inner > > class if you need to access your page instance's state)? Is that not a > > simpler design (ie you don't have to design your own custom page > > resolution for Wicket). > > > > If you really want to add a new way for Wicket to locate pages (ie as > > Spring managed beans as you say), I'd start by looking at how the > > IRequestTarget, RequestCycle and general mount strategy implementations > > interact but I'm sure one of the core developers will be able to give you > > a good steer - it's an interesting question (albeit, possibly academic). > > > > By the way, I guess you know that you can use AspectJ type configuration > > for Spring AOP, so you could write your aspects in a way applicable to > > both, but include an aop.xml in your MATA-INF and add the AspectJ agent > to > > your command line to enable introduction to unmanaged beans whilst > > avoiding the "self" problem. > > > > Regards - Cemal > > http://www.jWeekend.co.uk <http://www.jweekend.co.uk/> jWeekend > > > > > > > > miro wrote: > >> > >> I want to use spring aop on my pages , so was wondering if it is > possible > >> to make pages as proxy scoped spring beans and wicket will use > spring > >> application context to retrieve page instance , I actually wanted to > add > >> introduction to some of my pages and for whcih I cannot use spring > >> aop and must use some aop like aspectJ or something else . > >> > > > > > > -- > View this message in context: > http://www.nabble.com/wicket-pages-as---spring-beans--to-utilize-spring-aop-tp20964746p20981833.html > Sent from the Wicket - User mailing list archive at Nabble.com. > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [email protected] > For additional commands, e-mail: [email protected] > > -- Jeremy Thomerson http://www.wickettraining.com
