Re: [Wicket-user] beginners question: wicket and sessions
HI Joahn, Hi Igor, thx very much - emm, you dont how EJB sessions are working with wicket ? (do i have to tie the specific stateful bean to the session or does the container remember itself the bean to the session e.g.for a shopping cart...) Korbinian PS: you really should change the name from dirty() to snyc() or sth like that or even go a step further and use AOP to call this automatically whenever sth is touched Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Im Auftrag von Igor VaynbergGesendet: Sonntag, 13. August 2006 17:30An: wicket-user@lists.sourceforge.netBetreff: Re: [Wicket-user] beginners question: wicket and sessions wicket's session object is stored inside http session. the getters and setters there are to make your code cleaner then using http session's map:object-object which is pretty ugly - so instead you use typesafe getters and setters. and as johan pointed out whenever you modify wicket's session object you have to call dirty() on it - this call triggers replication so the session is updated across the cluster if you have one. -Igor On 8/13/06, Johan Compagner [EMAIL PROTECTED] wrote: No you dont have to have getters and setters but that is just a nice approache.How else would you get your data?And it is better to have a setter if the data can be changed because in the set you can call: dirty() which is for us a trigger to reset our session object in the the http session object so that it knows that the session object is changed.johan On 8/13/06, Korbinian Bachl [EMAIL PROTECTED] wrote: Hi, i have a small problem in understanding the way sessions are used in wicket. Whenever i access any new wicket app (even HelloWorld) it gives me a SID, so i know i have a (http servlet) session. However, using the http.session is not the wicket way, and the wiki just tells: Custom Sessions The wicket way of storing objects in your session is by extending the wicket session. For example if you want to store some kind of user object in your session, you would create a getter and setter for it in your custom wicket session: public class MySession extends WebSession { public MySession(WebApplication application) { super(application); } private String myAttribute; // ... getters and setters }But why do i have to explicitly do the getters and setters for each thing i want to have remembered?? -or did i get sth. wrong here??? Best Regards,KorbinianPS: a little bit off-topic, but im also working myself into ejb3 a bit and i wondered, if i have a stateful sessionBean (e.g. a ShoppingCart) and i call the bean in any wicket page and set a product into it, how will be remembered to what session the Cart is attached to? - do i have to keep the connection to the specific bean open all the time or does the beancontainer take care for that ??? -Using Tomcat but need to do more? Need to support web services, security?Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimohttp://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642___Wicket-user mailing listWicket-user@lists.sourceforge.nethttps://lists.sourceforge.net/lists/listinfo/wicket-user -Using Tomcat but need to do more? Need to support web services, security?Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimohttp://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642___Wicket-user mailing listWicket-user@lists.sourceforge.nethttps://lists.sourceforge.net/lists/listinfo/wicket-user - Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
Re: [Wicket-user] beginners question: wicket and sessions
On 8/14/06, Korbinian Bachl [EMAIL PROTECTED] wrote: thx very much - emm, you dont how EJB sessions are working with wicket ? (do i have to tie the specific stateful bean to the session or does the container remember itself the bean to the session e.g.for a shopping cart...)you get a session bean and store the stub in wicket's session object and thats how you reference it. so instead of stuffing it into httpsession you stuff it into wicket's. vincent wrote an ejb3 wicket app so maybe he can give you more input or you can woogle [1] for ejb3 PS: you really should change the name from dirty() to snyc() or sth like that or even go a step further and use AOP to call this automatically whenever sth is touchedwe like dirty() and havent had any complaints so far save this one. you can always do: MySession { public void sync() { dirty(); } } :) aop sounds nice, if there was an intercepor for change to any field value in any object in this instance we might consider it. we are not aop wizs so maybe there is one and we dont know about it. [1] http://woogle.billen.dk/search-Igor - Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
Re: [Wicket-user] beginners question: wicket and sessions
On 8/14/06, Korbinian Bachl [EMAIL PROTECTED] wrote: we like dirty() and havent had any complaints so far save this one. you can always do: MySession { public void sync() { dirty(); } } :) sure i can do this... i just meant u usuallydont think about snycronising whenseeing a dirty() - called functioni think dirty() is quiet standard. it tells the object that you changed it and now it needs to do whatever it needs to do to react to that. aop sounds nice, if there was an intercepor for change to any field value in any object in this instance we might consider it. we are not aop wizs so maybe there is one and we dont know about it. im neither,but you could call it everytime a page is processed?yes we could, but that would cause a ton of unnecessary replications and take away a lot of bandwidth inside the cluster. -Igor - Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
Re: [Wicket-user] beginners question: wicket and sessions
wicket's session object is stored inside http session. the getters and setters there are to make your code cleaner then using http session's map:object-object which is pretty ugly - so instead you use typesafe getters and setters. and as johan pointed out whenever you modify wicket's session object you have to call dirty() on it - this call triggers replication so the session is updated across the cluster if you have one. -IgorOn 8/13/06, Johan Compagner [EMAIL PROTECTED] wrote: No you dont have to have getters and setters but that is just a nice approache.How else would you get your data?And it is better to have a setter if the data can be changed because in the set you can call: dirty() which is for us a trigger to reset our session object in the the http session object so that it knows that the session object is changed.johan On 8/13/06, Korbinian Bachl [EMAIL PROTECTED] wrote: Hi, i have a small problem in understanding the way sessions are used in wicket. Whenever i access any new wicket app (even HelloWorld) it gives me a SID, so i know i have a (http servlet) session. However, using the http.session is not the wicket way, and the wiki just tells: Custom Sessions The wicket way of storing objects in your session is by extending the wicket session. For example if you want to store some kind of user object in your session, you would create a getter and setter for it in your custom wicket session: public class MySession extends WebSession { public MySession(WebApplication application) { super(application); } private String myAttribute; // ... getters and setters }But why do i have to explicitly do the getters and setters for each thing i want to have remembered?? -or did i get sth. wrong here??? Best Regards,KorbinianPS: a little bit off-topic, but im also working myself into ejb3 a bit and i wondered, if i have a stateful sessionBean (e.g. a ShoppingCart) and i call the bean in any wicket page and set a product into it, how will be remembered to what session the Cart is attached to? - do i have to keep the connection to the specific bean open all the time or does the beancontainer take care for that ??? -Using Tomcat but need to do more? Need to support web services, security?Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642___Wicket-user mailing list Wicket-user@lists.sourceforge.nethttps://lists.sourceforge.net/lists/listinfo/wicket-user -Using Tomcat but need to do more? Need to support web services, security?Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642___Wicket-user mailing list Wicket-user@lists.sourceforge.nethttps://lists.sourceforge.net/lists/listinfo/wicket-user - Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user