You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by jussi isokangas <ju...@gmail.com> on 2011/01/20 20:39:40 UTC
SwramWebApplication and session
Hi,
My application extends SwramWebApplication. Session doesn't accpet that for
paramater. I need to use session for ShoppingCart.
How to solve it?
Regards Jussi
Re: SwramWebApplication and session
Posted by jussi isokangas <ju...@gmail.com>.
Hi,
I solved it.
Your advise works with little parameter changes. Additionally I had to
change MySessio extends from WebSessio to SwampSessio.
Here my Application.class (VerkkokauppaSovellus)
*...*
*@Override
public Session newSession(Request request, Response response) {
return session = new Sessio(request,VerkkokauppaSovellus.this);
}
...*
and here Sessio.class
*package fi.harjoitustyo.verkkokauppa.web;
import org.apache.wicket.Request;
import org.apache.wicket.security.WaspSession;
*
*public class Sessio extends WaspSession{
private static final long serialVersionUID = 1L;
private Ostoskori ostoskori ;
public Sessio(Request request, VerkkokauppaSovellus sovellus){
super(sovellus,request);
ostoskori = new Ostoskori();
}
public Ostoskori haeOstoskori()
{ return ostoskori;
}
}
*and here Basepage*
public abstract class Sivupohja extends WebPage {
@SuppressWarnings("unused")
private static final Log log =
LogFactory.getLog(Sivupohja.class);
private static final long serialVersionUID = 1L;
protected Ostoskori ostoskori = ((Sessio)
getSession()).haeOstoskori();
...*
t. jussi
2011/1/21 Martin Makundi <ma...@koodaripalvelut.com>
> Hi!
>
> I am not sure what you mean, but we have like this:
>
> /**
> * @see com.myapp.MyApplication#newSession(org.apache.wicket.Request,
> org.apache.wicket.Response)
> */
> @Override
> public Session newSession(Request request, Response response) {
> return session = new MySession(request, response);
> }
>
> **
> Martin
>
> 2011/1/20 jussi isokangas <ju...@gmail.com>:
> > Hi,
> >
> > My application extends SwramWebApplication. Session doesn't accpet that
> for
> > paramater. I need to use session for ShoppingCart.
> > How to solve it?
> >
> > Regards Jussi
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>
Re: SwramWebApplication and session
Posted by Martin Makundi <ma...@koodaripalvelut.com>.
Hi!
I am not sure what you mean, but we have like this:
/**
* @see com.myapp.MyApplication#newSession(org.apache.wicket.Request,
org.apache.wicket.Response)
*/
@Override
public Session newSession(Request request, Response response) {
return session = new MySession(request, response);
}
**
Martin
2011/1/20 jussi isokangas <ju...@gmail.com>:
> Hi,
>
> My application extends SwramWebApplication. Session doesn't accpet that for
> paramater. I need to use session for ShoppingCart.
> How to solve it?
>
> Regards Jussi
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org