You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Marcin Palka <ma...@gmail.com> on 2009/07/07 21:48:51 UTC
FeedbackPanel does not show up on a page shown as a result of a
redirect using RestartResponseAtInterceptPageException
Hi Wicketers,
I noticed a strange behavior of FeedbackPanel that may be a bug. In my
application I've got a main page (MemberPage) which cannot be accessed
without authentication. I defined my own authorization strategy by
implementing IAuthorizationStrategy and
IUnauthorizedComponentInstantiationListener. My Application class'
getHomePage method returns MemberPage.class. If an user that is not
authenticated tries to access the MemberPage the
onUnauthorizedInstantiation method issues a redirect by throwing a
RestartResponseAtInterceptPageException(LoginPage.class). The user
gets redireted to a login page (LoginPage) which contains a
StatelessForm.
Now the trouble starts. If the user tries to authenticate using login
form and the authentication fails a FeedbackPanel (that is included in
the LoginPage) is supposed to be shown with an error message. But it
does not actually.
Log says that a FeedbackPanel was not on the page while it really was there.
Component-targetted feedback message was left unrendered. This could
be because you are missing a FeedbackPanel on the page. Message:
[FeedbackMessage message = "Wrong username or password", reporter =
signInForm, level = ERROR]
It looks like the submit somehow goes through MemberPage and again
it's redirected to the LoginPage:
WARN - WebSession - Component-targetted feedback
message was left unrendered. This could be because you are missing a
FeedbackPanel on the page. Message: [FeedbackMessage message = "Wrong
username or password", reporter = signInForm, level = ERROR]
INFO - RequestLogger -
time=22,event=BookmarkablePage[com.amsoft.portal.web.LoginPage(username
= "[wrong]" password = "[wrong]" signInForm2_hf_0 =
"[]")],response=org.apache.wicket.request.target.basic.RedirectRequestTarget@4ab84c,sessionid=4968885F0D823085ED38ED21DE73C4BC,sessionsize=1205,sessionstart=Tue
Jul 07 21:37:18 CEST
2009,requests=4,totaltime=367,activerequests=0,maxmem=66M,total=19M,used=12M
INFO - RequestLogger -
time=0,event=BookmarkablePage[com.amsoft.portal.web.MemberPage()],response=BookmarkablePage[com.amsoft.portal.web.LoginPage()],sessionid=4968885F0D823085ED38ED21DE73C4BC,sessionsize=1214,sessionstart=Tue
Jul 07 21:37:18 CEST
2009,requests=5,totaltime=367,activerequests=0,maxmem=66M,total=19M,used=12M
INFO - RequestLogger -
time=1,event=BookmarkablePage[com.amsoft.portal.web.LoginPage()],response=BookmarkablePage[com.amsoft.portal.web.LoginPage()],sessionid=4968885F0D823085ED38ED21DE73C4BC,sessionsize=1214,sessionstart=Tue
Jul 07 21:37:18 CEST
2009,requests=6,totaltime=368,activerequests=0,maxmem=66M,total=19M,used=12M
This happens only when using a
RestartResponseAtInterceptPageException. On the other hand if I use a
RequestCycle.get().setResponsePage(LoginPage.class); to issue a
redirect it works like a charm.
Is this a bug or maybe I just do not know how to use the
IUnauthorizedComponentInstantiationListener? Shall I fill a jira for
this one?
I attached a quickstart to reproduce the scenario. Created using 1.4-rc6.
cheers,
Marcin
A complete log output:
2009-07-07 21:45:14 org.apache.catalina.core.StandardContext start
INFO: Container
org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/portal]
has already been started
INFO - RequestLogger -
time=34,event=BookmarkablePage[com.amsoft.portal.web.MemberPage()],response=BookmarkablePage[com.amsoft.portal.web.MemberPage()],sessionid=null,sessionsize=840,activerequests=0,maxmem=66M,total=19M,used=12M
INFO - AuthorizationStrategy - isInstantiationAuthorized:class
com.amsoft.portal.web.MemberPage
INFO - RequestLogger -
time=53,event=BookmarkablePage[com.amsoft.portal.web.MemberPage()],response=BookmarkablePage[com.amsoft.portal.web.LoginPage()],sessionid=B9B91648F84EDEBABE04F8D6ACCFC54C,sessionsize=1214,sessionstart=Tue
Jul 07 21:45:14 CEST
2009,requests=2,totaltime=53,activerequests=0,maxmem=66M,total=19M,used=13M
INFO - AuthorizationStrategy - isInstantiationAuthorized:class
com.amsoft.portal.web.LoginPage
INFO - AuthorizationStrategy - isInstantiationAuthorized:class
org.apache.wicket.markup.html.panel.FeedbackPanel
INFO - AuthorizationStrategy - isInstantiationAuthorized:class
org.apache.wicket.markup.html.panel.FeedbackPanel$1
INFO - AuthorizationStrategy - isInstantiationAuthorized:class
org.apache.wicket.markup.html.panel.FeedbackPanel$MessageListView
INFO - AuthorizationStrategy - isInstantiationAuthorized:class
com.amsoft.portal.web.LoginPage$SignInForm
INFO - AuthorizationStrategy - isInstantiationAuthorized:class
org.apache.wicket.markup.html.form.TextField
INFO - AuthorizationStrategy - isInstantiationAuthorized:class
org.apache.wicket.markup.html.form.PasswordTextField
INFO - AuthorizationStrategy - isInstantiationAuthorized:class
org.apache.wicket.markup.html.internal.HtmlHeaderContainer
INFO - RequestLogger -
time=493,event=BookmarkablePage[com.amsoft.portal.web.LoginPage()],response=BookmarkablePage[com.amsoft.portal.web.LoginPage()],sessionid=B9B91648F84EDEBABE04F8D6ACCFC54C,sessionsize=1214,sessionstart=Tue
Jul 07 21:45:14 CEST
2009,requests=3,totaltime=546,activerequests=0,maxmem=66M,total=19M,used=13M
INFO - AuthorizationStrategy - isInstantiationAuthorized:class
com.amsoft.portal.web.LoginPage
INFO - AuthorizationStrategy - isInstantiationAuthorized:class
org.apache.wicket.markup.html.panel.FeedbackPanel
INFO - AuthorizationStrategy - isInstantiationAuthorized:class
org.apache.wicket.markup.html.panel.FeedbackPanel$1
INFO - AuthorizationStrategy - isInstantiationAuthorized:class
org.apache.wicket.markup.html.panel.FeedbackPanel$MessageListView
INFO - AuthorizationStrategy - isInstantiationAuthorized:class
com.amsoft.portal.web.LoginPage$SignInForm
INFO - AuthorizationStrategy - isInstantiationAuthorized:class
org.apache.wicket.markup.html.form.TextField
INFO - AuthorizationStrategy - isInstantiationAuthorized:class
org.apache.wicket.markup.html.form.PasswordTextField
WARN - WebSession - Component-targetted feedback
message was left unrendered. This could be because you are missing a
FeedbackPanel on the page. Message: [FeedbackMessage message = "Wrong
username or password", reporter = signInForm, level = ERROR]
INFO - RequestLogger -
time=169,event=BookmarkablePage[com.amsoft.portal.web.LoginPage(username
= "[wrong]" password = "[wrong]" signInForm2_hf_0 =
"[]")],response=org.apache.wicket.request.target.basic.RedirectRequestTarget@149e3c0,sessionid=B9B91648F84EDEBABE04F8D6ACCFC54C,sessionsize=1205,sessionstart=Tue
Jul 07 21:45:14 CEST
2009,requests=4,totaltime=715,activerequests=0,maxmem=66M,total=19M,used=13M
INFO - AuthorizationStrategy - isInstantiationAuthorized:class
com.amsoft.portal.web.MemberPage
INFO - RequestLogger -
time=1,event=BookmarkablePage[com.amsoft.portal.web.MemberPage()],response=BookmarkablePage[com.amsoft.portal.web.LoginPage()],sessionid=B9B91648F84EDEBABE04F8D6ACCFC54C,sessionsize=1214,sessionstart=Tue
Jul 07 21:45:14 CEST
2009,requests=5,totaltime=716,activerequests=0,maxmem=66M,total=19M,used=14M
INFO - AuthorizationStrategy - isInstantiationAuthorized:class
com.amsoft.portal.web.LoginPage
INFO - AuthorizationStrategy - isInstantiationAuthorized:class
org.apache.wicket.markup.html.panel.FeedbackPanel
INFO - AuthorizationStrategy - isInstantiationAuthorized:class
org.apache.wicket.markup.html.panel.FeedbackPanel$1
INFO - AuthorizationStrategy - isInstantiationAuthorized:class
org.apache.wicket.markup.html.panel.FeedbackPanel$MessageListView
INFO - AuthorizationStrategy - isInstantiationAuthorized:class
com.amsoft.portal.web.LoginPage$SignInForm
INFO - AuthorizationStrategy - isInstantiationAuthorized:class
org.apache.wicket.markup.html.form.TextField
INFO - AuthorizationStrategy - isInstantiationAuthorized:class
org.apache.wicket.markup.html.form.PasswordTextField
INFO - AuthorizationStrategy - isInstantiationAuthorized:class
org.apache.wicket.markup.html.internal.HtmlHeaderContainer
INFO - RequestLogger -
time=153,event=BookmarkablePage[com.amsoft.portal.web.LoginPage()],response=BookmarkablePage[com.amsoft.portal.web.LoginPage()],sessionid=B9B91648F84EDEBABE04F8D6ACCFC54C,sessionsize=1214,sessionstart=Tue
Jul 07 21:45:14 CEST
2009,requests=6,totaltime=869,activerequests=0,maxmem=66M,total=19M,used=13M
Re: FeedbackPanel does not show up on a page shown as a result of a
redirect using RestartResponseAtInterceptPageException
Posted by Marcin Palka <ma...@gmail.com>.
It turns out to be my bad. I call the continueToOriginalDestination method to
log the value that it returns. It seems this call causes the unwanted
redirect. Removing the following line seems to make the trick.
logger.debug("onSubmit username=" + username +
" password=" + password +
" continueToOriginalDestination=" + continueToOriginalDestination());
--
View this message in context: http://www.nabble.com/FeedbackPanel-does-not-show-up-on-a-page-shown-as-a-result-of-a--redirect-using-RestartResponseAtInterceptPageException-tp24380159p24382117.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