you need to override newsession on the app and return your subclass....
-igor
On Fri, Feb 15, 2008 at 2:00 AM, Sven Schliesing
<[EMAIL PROTECTED]> wrote:
>
> I think I don't get it :(
>
> I narrowed down the problem to this test case. It would be great if you
> could take a look:
>
> -----------------------
> public class WebApplicationTest {
>
> public class CustomSession extends WebSession {
> public CustomSession(Request request) {
> super(request);
> }
> }
>
> public class MyApplication extends SpringWebApplication {
>
> private SpringComponentInjector springComponentInjector;
>
>
> @Override
> public Session newSession(Request request, Response response)
> {
> return new CustomSession(request);
> }
>
> public void setSpringComponentInjector(SpringComponentInjector
> springComponentInjector) {
> this.springComponentInjector =
> springComponentInjector;
> }
>
>
> @Override
> protected void init() {
> if (springComponentInjector == null) {
> springComponentInjector = new
> SpringComponentInjector(this);
> }
>
> addComponentInstantiationListener(springComponentInjector);
> }
>
> @Override
> public Class getHomePage() {
> return null;
> }
>
> }
>
> @Test
> public void test() {
> AnnotApplicationContextMock mockAppCtx = new
> AnnotApplicationContextMock();
>
> MyApplication myApp = new MyApplication();
> myApp.setSpringComponentInjector(new
> SpringComponentInjector(myApp,
> mockAppCtx));
>
> WicketTester wicketTester = new WicketTester(myApp);
> }
> }
> -----------------------
> --
> View this message in context:
> http://www.nabble.com/org.apache.wicket.protocol.http.WebSession-cannot-be-cast-to-my.CustomSession-tp15480791p15496951.html
>
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
>
>
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]