You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Chris Lintz <ch...@gmail.com> on 2007/10/24 05:44:21 UTC

Button component bug - all uses of a Button cause a 302 redirect

Hey all,
We are quite puzzled why this is happening.  Every use of a Button onSubmit
causes a 302 redirect no matter if it posts a form or does a get.  I have
simplified this down to a simple page with a Button and guaranteed there are
no Apache redirects or .htaccess files in play.  I also ensured the default
WebRequestCodingStrategy is used and the WebApplications
newRequestCycleProcessor() is not overloaded.

We are running Wicket 3 Beta4 inside Tomcat 5.5 (although I believe Beta3 
has the same issue) .  This only occurs with Buttons.  Ajax posts and other
Link components make it through just fine.  A Button as simple as this
causes the redirect:

Button testBtn1 = new Button("testBtn1")
{
  @Override
   public void onSubmit()
  {
     info("No response page ");
  }
};
 
Below is the proof a redirect is sent (with ourdomain.com in replace of our
real domain for privacy).


POST /?wicket:interface=:3:testForm::IFormSubmitListener:: HTTP/1.1

Host: ourdomain.com

User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en-US; rv:1.8.1.4)
Gecko/20070515 Firefox/2.0.0.4

Accept:
text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5

Accept-Language: en-us,en;q=0.5

Accept-Encoding: gzip,deflate

Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7

Keep-Alive: 300

Connection: keep-alive

Referer: http://ourdomain.com/?wicket:interface=:3::::

Cookie: JSESSIONID=2888082B1246E97B83C30DEC73479AE4.node1

Content-Type: application/x-www-form-urlencoded

Content-Length: 34

testForm7_hf_0=&testBtn1=Info+Only

HTTP/1.x 302 Moved Temporarily

Date: Wed, 24 Oct 2007 03:23:46 GMT

Server: Apache/2.2.4 (Unix) mod_ssl/2.2.4 OpenSSL/0.9.8e DAV/2 mod_jk/1.2.22

X-Powered-By: Servlet 2.4; JBoss-4.2.1.GA (build: SVNTag=JBoss_4_2_1_GA
date=200707131605)/Tomcat-5.5

Location: http://ourdomain.com/?wicket:interface=:3::::

Content-Length: 0

Keep-Alive: timeout=5, max=100

Connection: Keep-Alive

Content-Type: text/plain



Any ideas why this is happening?

Thanks


chris


-- 
View this message in context: http://www.nabble.com/Button-component-bug---all-uses-of-a-Button-cause-a-302-redirect-tf4681842.html#a13378576
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: Button component bug - all uses of a Button cause a 302 redirect

Posted by Matej Knopp <ma...@gmail.com>.
You can call setRedirect(false) during the request in the onSubmit
handler, that should prevent wicket from redirecting in that
particular case.

-Matej

On 10/24/07, Chris Lintz <ch...@gmail.com> wrote:
>
> Ok.  Its a good thing.. I didnt know it was the default setting.  I guess i
> should thank you because it exposed a classic issue seen when having SSL
> accelerators proxying requests to port 80 .  The redirect was redirecting
> off https.  I have fixed this by setting correct headers at the accelerator
> box.
>
> Anyways, I don't need to change to ONE_PASS_RENDERER but for my knowledge
> going forward,  it appears this cannot be set per request?
>
>
>
> Eelco Hillenius wrote:
> >
> > On 10/23/07, Igor Vaynberg <ig...@gmail.com> wrote:
> >> yep, this is called a redirect-after-post pattern - i suggest you look
> >> it up. it is the preferred way of building webapps and wicket gives
> >> you it for free. so actually this is a Good Thing (tm).
> >
> > Yup. Read the docs on IRequestCycleSettings#RenderStrategy. The
> > default is REDIRECT_TO_BUFFER. If you don't like this behavior, you
> > can set it to ONE_PASS_RENDER.
> >
> > Eelco
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> > For additional commands, e-mail: users-help@wicket.apache.org
> >
> >
> >
>
> --
> View this message in context: http://www.nabble.com/Button-component-bug---all-uses-of-a-Button-cause-a-302-redirect-tf4681842.html#a13379870
> 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


Re: Button component bug - all uses of a Button cause a 302 redirect

Posted by Chris Lintz <ch...@gmail.com>.
Ok.  Its a good thing.. I didnt know it was the default setting.  I guess i
should thank you because it exposed a classic issue seen when having SSL
accelerators proxying requests to port 80 .  The redirect was redirecting
off https.  I have fixed this by setting correct headers at the accelerator
box.

Anyways, I don't need to change to ONE_PASS_RENDERER but for my knowledge
going forward,  it appears this cannot be set per request?



Eelco Hillenius wrote:
> 
> On 10/23/07, Igor Vaynberg <ig...@gmail.com> wrote:
>> yep, this is called a redirect-after-post pattern - i suggest you look
>> it up. it is the preferred way of building webapps and wicket gives
>> you it for free. so actually this is a Good Thing (tm).
> 
> Yup. Read the docs on IRequestCycleSettings#RenderStrategy. The
> default is REDIRECT_TO_BUFFER. If you don't like this behavior, you
> can set it to ONE_PASS_RENDER.
> 
> Eelco
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Button-component-bug---all-uses-of-a-Button-cause-a-302-redirect-tf4681842.html#a13379870
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: Button component bug - all uses of a Button cause a 302 redirect

Posted by Eelco Hillenius <ee...@gmail.com>.
On 10/23/07, Igor Vaynberg <ig...@gmail.com> wrote:
> yep, this is called a redirect-after-post pattern - i suggest you look
> it up. it is the preferred way of building webapps and wicket gives
> you it for free. so actually this is a Good Thing (tm).

Yup. Read the docs on IRequestCycleSettings#RenderStrategy. The
default is REDIRECT_TO_BUFFER. If you don't like this behavior, you
can set it to ONE_PASS_RENDER.

Eelco

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


Re: Button component bug - all uses of a Button cause a 302 redirect

Posted by Igor Vaynberg <ig...@gmail.com>.
yep, this is called a redirect-after-post pattern - i suggest you look
it up. it is the preferred way of building webapps and wicket gives
you it for free. so actually this is a Good Thing (tm).

-igor


On 10/23/07, Chris Lintz <ch...@gmail.com> wrote:
>
> Hey all,
> We are quite puzzled why this is happening.  Every use of a Button onSubmit
> causes a 302 redirect no matter if it posts a form or does a get.  I have
> simplified this down to a simple page with a Button and guaranteed there are
> no Apache redirects or .htaccess files in play.  I also ensured the default
> WebRequestCodingStrategy is used and the WebApplications
> newRequestCycleProcessor() is not overloaded.
>
> We are running Wicket 3 Beta4 inside Tomcat 5.5 (although I believe Beta3
> has the same issue) .  This only occurs with Buttons.  Ajax posts and other
> Link components make it through just fine.  A Button as simple as this
> causes the redirect:
>
> Button testBtn1 = new Button("testBtn1")
> {
>   @Override
>    public void onSubmit()
>   {
>      info("No response page ");
>   }
> };
>
> Below is the proof a redirect is sent (with ourdomain.com in replace of our
> real domain for privacy).
>
>
> POST /?wicket:interface=:3:testForm::IFormSubmitListener:: HTTP/1.1
>
> Host: ourdomain.com
>
> User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en-US; rv:1.8.1.4)
> Gecko/20070515 Firefox/2.0.0.4
>
> Accept:
> text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
>
> Accept-Language: en-us,en;q=0.5
>
> Accept-Encoding: gzip,deflate
>
> Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
>
> Keep-Alive: 300
>
> Connection: keep-alive
>
> Referer: http://ourdomain.com/?wicket:interface=:3::::
>
> Cookie: JSESSIONID=2888082B1246E97B83C30DEC73479AE4.node1
>
> Content-Type: application/x-www-form-urlencoded
>
> Content-Length: 34
>
> testForm7_hf_0=&testBtn1=Info+Only
>
> HTTP/1.x 302 Moved Temporarily
>
> Date: Wed, 24 Oct 2007 03:23:46 GMT
>
> Server: Apache/2.2.4 (Unix) mod_ssl/2.2.4 OpenSSL/0.9.8e DAV/2 mod_jk/1.2.22
>
> X-Powered-By: Servlet 2.4; JBoss-4.2.1.GA (build: SVNTag=JBoss_4_2_1_GA
> date=200707131605)/Tomcat-5.5
>
> Location: http://ourdomain.com/?wicket:interface=:3::::
>
> Content-Length: 0
>
> Keep-Alive: timeout=5, max=100
>
> Connection: Keep-Alive
>
> Content-Type: text/plain
>
>
>
> Any ideas why this is happening?
>
> Thanks
>
>
> chris
>
>
> --
> View this message in context: http://www.nabble.com/Button-component-bug---all-uses-of-a-Button-cause-a-302-redirect-tf4681842.html#a13378576
> 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