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

Reply via email to