You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by qssdy <ch...@gmail.com> on 2009/03/10 02:00:20 UTC

PageExpiredException after mounting WebPage package

Wicket version: 1.4-rc1

Hi,

     I'm very new to Wicket, so I'm probably making a simple mistake that I
overlooked.  Thank you for your insights ahead of time.

     I have a small wicket application consisting of about 8-10 pages -
interconnected by ~50% links and ~50% form submissions.

     Now everything was (is) fine until I mounted the single package
containing all of my web pages.  Then all of my links in the application are
converted from the Wicket default (e.g.
http://localhost:8080/?wicket:bookmarkablePage=:my.package.MyPage) to the
mounted format (e.g. http://localhost:8080/pages/MyPage/).  That much is
fine; all the links still work.

     However, none of my form submissions work - they all result in
PageExpiredException (no form or button onSubmit() methods are called) and
are redirected to the page expired error page.  I have done some debugging,
and it seems to me that the problem lies in the fact that 

org.apache.wicket.Session: line 771
pageMap.get(Integer.parseInt(id), versionNumber);

returns null.

     Interestingly, I tested whether Wicket still understands its
default/canonical URL form by going to
http://localhost:8080/?wicket:bookmarkablePage=:my.package.MyPage directly
via the browser URL field.  That works, and what's more, immediately after
that, all my form submissions work and pageMap.get() returns a valid Page!

     To me this seems like the Application may need to be initialized
somehow that I am not doing, or perhaps I am calling the mount() method at
the wrong time.  Here are code snippets for my custom application:

package my.package;

import org.apache.wicket.protocol.http.WebApplication;
import org.apache.wicket.spring.injection.annot.SpringComponentInjector;

public class MyApplication extends WebApplication {
	public MyApplication() {
	}

	@Override
	public void init() {
		addComponentInstantiationListener(new SpringComponentInjector(this,
mySpringApplicationContext));
		getApplicationSettings().setPageExpiredErrorPage(MyExpiredPage.class);
		getApplicationSettings().setAccessDeniedPage(MyAccessDeniedPage.class);
		getApplicationSettings().setInternalErrorPage(MyInternalErrorPage.class);
	
getExceptionSettings().setUnexpectedExceptionDisplay(IExceptionSettings.SHOW_INTERNAL_ERROR_PAGE);
		mount("pages", PackageName.forClass(MyPage.class));
//		mountBookmarkablePage("MyPage", MyPage.class);
	}
}

	Interestingly, the code (and forms) works if I uncomment the line that only
mounts a single page and comment out the previous line that mounts the
entire package.

	Thanks again for any help you can offer!
-- 
View this message in context: http://www.nabble.com/PageExpiredException-after-mounting-WebPage-package-tp22426042p22426042.html
Sent from the Wicket - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: PageExpiredException after mounting WebPage package

Posted by qssdy <ch...@gmail.com>.
Wow, your 1 line directed me to the problem.  That's awesome, thanks!

The problem turned out to be that we had put the HazelCast filter in front
of Wicket.  We haven't debugged what the interaction problem is, but
removing the HazelCast filter and sending requests directly to Wicket works.

Thanks again!
-- 
View this message in context: http://www.nabble.com/PageExpiredException-after-mounting-WebPage-package-tp22426042p22440036.html
Sent from the Wicket - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: PageExpiredException after mounting WebPage package

Posted by Igor Vaynberg <ig...@gmail.com>.
what is your filter mapping?

-igor

On Mon, Mar 9, 2009 at 6:00 PM, qssdy <ch...@gmail.com> wrote:
>
> Wicket version: 1.4-rc1
>
> Hi,
>
>     I'm very new to Wicket, so I'm probably making a simple mistake that I
> overlooked.  Thank you for your insights ahead of time.
>
>     I have a small wicket application consisting of about 8-10 pages -
> interconnected by ~50% links and ~50% form submissions.
>
>     Now everything was (is) fine until I mounted the single package
> containing all of my web pages.  Then all of my links in the application are
> converted from the Wicket default (e.g.
> http://localhost:8080/?wicket:bookmarkablePage=:my.package.MyPage) to the
> mounted format (e.g. http://localhost:8080/pages/MyPage/).  That much is
> fine; all the links still work.
>
>     However, none of my form submissions work - they all result in
> PageExpiredException (no form or button onSubmit() methods are called) and
> are redirected to the page expired error page.  I have done some debugging,
> and it seems to me that the problem lies in the fact that
>
> org.apache.wicket.Session: line 771
> pageMap.get(Integer.parseInt(id), versionNumber);
>
> returns null.
>
>     Interestingly, I tested whether Wicket still understands its
> default/canonical URL form by going to
> http://localhost:8080/?wicket:bookmarkablePage=:my.package.MyPage directly
> via the browser URL field.  That works, and what's more, immediately after
> that, all my form submissions work and pageMap.get() returns a valid Page!
>
>     To me this seems like the Application may need to be initialized
> somehow that I am not doing, or perhaps I am calling the mount() method at
> the wrong time.  Here are code snippets for my custom application:
>
> package my.package;
>
> import org.apache.wicket.protocol.http.WebApplication;
> import org.apache.wicket.spring.injection.annot.SpringComponentInjector;
>
> public class MyApplication extends WebApplication {
>        public MyApplication() {
>        }
>
>        @Override
>        public void init() {
>                addComponentInstantiationListener(new SpringComponentInjector(this,
> mySpringApplicationContext));
>                getApplicationSettings().setPageExpiredErrorPage(MyExpiredPage.class);
>                getApplicationSettings().setAccessDeniedPage(MyAccessDeniedPage.class);
>                getApplicationSettings().setInternalErrorPage(MyInternalErrorPage.class);
>
> getExceptionSettings().setUnexpectedExceptionDisplay(IExceptionSettings.SHOW_INTERNAL_ERROR_PAGE);
>                mount("pages", PackageName.forClass(MyPage.class));
> //              mountBookmarkablePage("MyPage", MyPage.class);
>        }
> }
>
>        Interestingly, the code (and forms) works if I uncomment the line that only
> mounts a single page and comment out the previous line that mounts the
> entire package.
>
>        Thanks again for any help you can offer!
> --
> View this message in context: http://www.nabble.com/PageExpiredException-after-mounting-WebPage-package-tp22426042p22426042.html
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org