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 Vaynberg
Gesendet: Sonntag, 13. August 2006 17:30
An: wicket-user@lists.sourceforge.net
Betreff: 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,


Korbinian

PS: 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=lnk&kid=120709&bid=263057&dat=121642

_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://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=lnk&kid=120709&bid=263057&dat=121642

_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://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=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to