The wicket way of storing objects in your session is by extending the
wicket session. For example if you want to store somekind of User
object in your session, you would create a getter and setter for it in
your custom wicket session.
For wicket to work with your custom session you should either
overwrite newSession() in WebApplication or provide your own
ISessionFactory.

Maurice

On 5/16/06, Nino Wael <[EMAIL PROTECTED]> wrote:



Hi



I have an object I would like to have stored in session, so that I may pass
it between pages. I've been looking at some sniplets and created this code
for setting the object:



HttpServletRequest request =
((WebRequest)RequestCycle.get().getRequest()).getHttpServletRequest();



request.setAttribute("here", "Hello world");



I am setting the value on the base of a panel which holds a button that
contains the below code in a onsubmit override.



And this piece for getting the value:



HttpServletRequest request = ((WebRequest)
RequestCycle.get().getRequest()).getHttpServletRequest();

String Message = (String) request.getAttribute("here");

info(Message);



I am getting the value on a onsubmit of a button.



However my String(message) are null how can that be, does it have something
to do with the scope?? If I paste the getting code in the same place as my
setting code it works just fine.





I do also feel that this is not 100% the wicket way to do it, so I must have
overlooked the better way?






-------------------------------------------------------
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&kid0709&bid&3057&dat1642
_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to