Re: [Wicket-user] AbortWithWebErrorCodeException not working as expected
See https://issues.apache.org/jira/browse/WICKET-552 On 5/10/07, Lowell Kirsh [EMAIL PROTECTED] wrote: I easily reproduced this problem. I did not use svn access, but instead went to the wicket main page and downloaded the 1.2.6 quickstart. I ran it and it worked. Then I went to the Index.java and inserted the following line in the constructor: throw new AbortWithWebErrorCodeException(HttpServletResponse.SC_BAD_REQUEST, FOOBAR); I went to my web browser, and again, blank page. Then I went to the command line and typed: $ wget http://localhost:8081/quickstart/app I get a 200 status code, with empty body: --14:50:42-- http://localhost:8081/quickstart/app = `app.1' Resolving localhost... done. Connecting to localhost[127.0.0.1]:8081... connected. HTTP request sent, awaiting response... 200 OK Length: unspecified [ = ] 0 --.--K/s 14:50:42 (0.00 B/s) - `app.1' saved [0] So do you think this is a bug? Lowell On 5/9/07, Johan Compagner [EMAIL PROTECTED] wrote: yes see our quickstart project in svn i can try to build an example for this for example if i change one of the wicket examples homepages that it throws such an exception does it fail then? johan On 5/9/07, Lowell Kirsh [EMAIL PROTECTED] wrote: do you have a quickstart that you can attach to a jira issue? What do you mean by this? Is a quickstart some sort of self-contained minimal jar? - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
Re: [Wicket-user] AbortWithWebErrorCodeException not working as expected
The solution you posted there looks workable. Instead of throwing an AbortException, I'd just call RequestCycle.get().setRequestTarget(...). However, it seems that to prevent the rest of my constructor from running (due to the error), I have to explicitly call 'return' (ie. can't use exception to get out of constructor). Is there any way I could exit without calling 'return'? Ok, if that wasn't clear, what I'd like to do is to have a method requireParameter(PageParams pp, String paramName) in my BasePage, so that if the paramName value is missing, the constructor would exit immediately with a redirect or error page. Using exceptions, I'd be able to simply call: requireParameter(...) and it could throw an exception which would take care of the control flow of the program. But instead, what I seem to be doing now is: if (isMissingParameter(params, paramName)) return; which is more verbose, but definitely not hideous. On 5/10/07, Eelco Hillenius [EMAIL PROTECTED] wrote: See https://issues.apache.org/jira/browse/WICKET-552 On 5/10/07, Lowell Kirsh [EMAIL PROTECTED] wrote: I easily reproduced this problem. I did not use svn access, but instead went to the wicket main page and downloaded the 1.2.6 quickstart. I ran it and it worked. Then I went to the Index.java and inserted the following line in the constructor: throw new AbortWithWebErrorCodeException(HttpServletResponse.SC_BAD_REQUEST, FOOBAR); I went to my web browser, and again, blank page. Then I went to the command line and typed: $ wget http://localhost:8081/quickstart/app I get a 200 status code, with empty body: --14:50:42-- http://localhost:8081/quickstart/app = `app.1' Resolving localhost... done. Connecting to localhost[127.0.0.1]:8081... connected. HTTP request sent, awaiting response... 200 OK Length: unspecified [ = ] 0 --.--K/s 14:50:42 (0.00 B/s) - `app.1' saved [0] So do you think this is a bug? Lowell On 5/9/07, Johan Compagner [EMAIL PROTECTED] wrote: yes see our quickstart project in svn i can try to build an example for this for example if i change one of the wicket examples homepages that it throws such an exception does it fail then? johan On 5/9/07, Lowell Kirsh [EMAIL PROTECTED] wrote: do you have a quickstart that you can attach to a jira issue? What do you mean by this? Is a quickstart some sort of self-contained minimal jar? - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
Re: [Wicket-user] AbortWithWebErrorCodeException not working as expected
It was a bug we didn't support it properly, and in trunk it's fixed now (note that the issue is set to 'resolved'). So put in that exception again, and you should be good. Eelco On 5/10/07, Lowell Kirsh [EMAIL PROTECTED] wrote: The solution you posted there looks workable. Instead of throwing an AbortException, I'd just call RequestCycle.get().setRequestTarget(...). However, it seems that to prevent the rest of my constructor from running (due to the error), I have to explicitly call 'return' (ie. can't use exception to get out of constructor). Is there any way I could exit without calling 'return'? Ok, if that wasn't clear, what I'd like to do is to have a method requireParameter(PageParams pp, String paramName) in my BasePage, so that if the paramName value is missing, the constructor would exit immediately with a redirect or error page. Using exceptions, I'd be able to simply call: requireParameter(...) and it could throw an exception which would take care of the control flow of the program. But instead, what I seem to be doing now is: if (isMissingParameter(params, paramName)) return; which is more verbose, but definitely not hideous. On 5/10/07, Eelco Hillenius [EMAIL PROTECTED] wrote: See https://issues.apache.org/jira/browse/WICKET-552 On 5/10/07, Lowell Kirsh [EMAIL PROTECTED] wrote: I easily reproduced this problem. I did not use svn access, but instead went to the wicket main page and downloaded the 1.2.6 quickstart. I ran it and it worked. Then I went to the Index.java and inserted the following line in the constructor: throw new AbortWithWebErrorCodeException(HttpServletResponse.SC_BAD_REQUEST, FOOBAR); I went to my web browser, and again, blank page. Then I went to the command line and typed: $ wget http://localhost:8081/quickstart/app I get a 200 status code, with empty body: --14:50:42-- http://localhost:8081/quickstart/app = `app.1' Resolving localhost... done. Connecting to localhost[127.0.0.1]:8081... connected. HTTP request sent, awaiting response... 200 OK Length: unspecified [ = ] 0 --.--K/s 14:50:42 (0.00 B/s) - `app.1' saved [0] So do you think this is a bug? Lowell On 5/9/07, Johan Compagner [EMAIL PROTECTED] wrote: yes see our quickstart project in svn i can try to build an example for this for example if i change one of the wicket examples homepages that it throws such an exception does it fail then? johan On 5/9/07, Lowell Kirsh [EMAIL PROTECTED] wrote: do you have a quickstart that you can attach to a jira issue? What do you mean by this? Is a quickstart some sort of self-contained minimal jar? - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version
Re: [Wicket-user] AbortWithWebErrorCodeException not working as expected
Thanks for your attention to this. Is there a roadmap of when 1.2.7 will be out? Or is 1.3.0 the next version? On 5/10/07, Eelco Hillenius [EMAIL PROTECTED] wrote: It was a bug we didn't support it properly, and in trunk it's fixed now (note that the issue is set to 'resolved'). So put in that exception again, and you should be good. Eelco On 5/10/07, Lowell Kirsh [EMAIL PROTECTED] wrote: The solution you posted there looks workable. Instead of throwing an AbortException, I'd just call RequestCycle.get().setRequestTarget(...). However, it seems that to prevent the rest of my constructor from running (due to the error), I have to explicitly call 'return' (ie. can't use exception to get out of constructor). Is there any way I could exit without calling 'return'? Ok, if that wasn't clear, what I'd like to do is to have a method requireParameter(PageParams pp, String paramName) in my BasePage, so that if the paramName value is missing, the constructor would exit immediately with a redirect or error page. Using exceptions, I'd be able to simply call: requireParameter(...) and it could throw an exception which would take care of the control flow of the program. But instead, what I seem to be doing now is: if (isMissingParameter(params, paramName)) return; which is more verbose, but definitely not hideous. On 5/10/07, Eelco Hillenius [EMAIL PROTECTED] wrote: See https://issues.apache.org/jira/browse/WICKET-552 On 5/10/07, Lowell Kirsh [EMAIL PROTECTED] wrote: I easily reproduced this problem. I did not use svn access, but instead went to the wicket main page and downloaded the 1.2.6 quickstart. I ran it and it worked. Then I went to the Index.java and inserted the following line in the constructor: throw new AbortWithWebErrorCodeException(HttpServletResponse.SC_BAD_REQUEST, FOOBAR); I went to my web browser, and again, blank page. Then I went to the command line and typed: $ wget http://localhost:8081/quickstart/app I get a 200 status code, with empty body: --14:50:42-- http://localhost:8081/quickstart/app = `app.1' Resolving localhost... done. Connecting to localhost[127.0.0.1]:8081... connected. HTTP request sent, awaiting response... 200 OK Length: unspecified [ = ] 0 --.--K/s 14:50:42 (0.00 B/s) - `app.1' saved [0] So do you think this is a bug? Lowell On 5/9/07, Johan Compagner [EMAIL PROTECTED] wrote: yes see our quickstart project in svn i can try to build an example for this for example if i change one of the wicket examples homepages that it throws such an exception does it fail then? johan On 5/9/07, Lowell Kirsh [EMAIL PROTECTED] wrote: do you have a quickstart that you can attach to a jira issue? What do you mean by this? Is a quickstart some sort of self-contained minimal jar? - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/
Re: [Wicket-user] AbortWithWebErrorCodeException not working as expected
1.3.x is the next version, and this is in trunk. I've only fixed it for that. If you really need it for 1.2.7, please re-open the issue and state that and selected 1.2.7 in the list. There's no roadmap for 1.2.7. It depends on severity of the bugs we fix for it and how badly people (tell us they) need it. But we're advising people to upgrade to 1.3.x if they can. In your case, if you're working on 1.2.x, the workaround is to create your own AbortWithWebErrorCodeException implementation, but now let it extend AbstractRestartResponseException (like the fix did). Nothing wrong with doing that, and it should work without having to upgrade. Eelco On 5/11/07, Lowell Kirsh [EMAIL PROTECTED] wrote: Thanks for your attention to this. Is there a roadmap of when 1.2.7 will be out? Or is 1.3.0 the next version? On 5/10/07, Eelco Hillenius [EMAIL PROTECTED] wrote: It was a bug we didn't support it properly, and in trunk it's fixed now (note that the issue is set to 'resolved'). So put in that exception again, and you should be good. Eelco On 5/10/07, Lowell Kirsh [EMAIL PROTECTED] wrote: The solution you posted there looks workable. Instead of throwing an AbortException, I'd just call RequestCycle.get().setRequestTarget(...). However, it seems that to prevent the rest of my constructor from running (due to the error), I have to explicitly call 'return' (ie. can't use exception to get out of constructor). Is there any way I could exit without calling 'return'? Ok, if that wasn't clear, what I'd like to do is to have a method requireParameter(PageParams pp, String paramName) in my BasePage, so that if the paramName value is missing, the constructor would exit immediately with a redirect or error page. Using exceptions, I'd be able to simply call: requireParameter(...) and it could throw an exception which would take care of the control flow of the program. But instead, what I seem to be doing now is: if (isMissingParameter(params, paramName)) return; which is more verbose, but definitely not hideous. On 5/10/07, Eelco Hillenius [EMAIL PROTECTED] wrote: See https://issues.apache.org/jira/browse/WICKET-552 On 5/10/07, Lowell Kirsh [EMAIL PROTECTED] wrote: I easily reproduced this problem. I did not use svn access, but instead went to the wicket main page and downloaded the 1.2.6 quickstart. I ran it and it worked. Then I went to the Index.java and inserted the following line in the constructor: throw new AbortWithWebErrorCodeException(HttpServletResponse.SC_BAD_REQUEST, FOOBAR); I went to my web browser, and again, blank page. Then I went to the command line and typed: $ wget http://localhost:8081/quickstart/app I get a 200 status code, with empty body: --14:50:42-- http://localhost:8081/quickstart/app = `app.1' Resolving localhost... done. Connecting to localhost[127.0.0.1]:8081... connected. HTTP request sent, awaiting response... 200 OK Length: unspecified [ = ] 0 --.--K/s 14:50:42 (0.00 B/s) - `app.1' saved [0] So do you think this is a bug? Lowell On 5/9/07, Johan Compagner [EMAIL PROTECTED] wrote: yes see our quickstart project in svn i can try to build an example for this for example if i change one of the wicket examples homepages that it throws such an exception does it fail then? johan On 5/9/07, Lowell Kirsh [EMAIL PROTECTED] wrote: do you have a quickstart that you can attach to a jira issue? What do you mean by this? Is a quickstart some sort of self-contained minimal jar? - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
Re: [Wicket-user] AbortWithWebErrorCodeException not working as expected
that should work fine looking in the code i do see this: RequestCycle.get().setRequestTarget(new WebErrorCodeResponseTarget(errorCode, message)); do you have a quickstart that you can attach to a jira issue? johan On 5/9/07, Lowell Kirsh [EMAIL PROTECTED] wrote: I throw an AbortWithWebErrorCodeException with status=HttpServletResponse.SC_BAD_REQUEST from my WebPage constructor and my web browser receives a 200 status code and shows a blank page. What am I doing wrong? Thanks, Lowell - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
Re: [Wicket-user] AbortWithWebErrorCodeException not working as expected
do you have a quickstart that you can attach to a jira issue? What do you mean by this? Is a quickstart some sort of self-contained minimal jar? - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
Re: [Wicket-user] AbortWithWebErrorCodeException not working as expected
yes see our quickstart project in svn i can try to build an example for this for example if i change one of the wicket examples homepages that it throws such an exception does it fail then? johan On 5/9/07, Lowell Kirsh [EMAIL PROTECTED] wrote: do you have a quickstart that you can attach to a jira issue? What do you mean by this? Is a quickstart some sort of self-contained minimal jar? - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
Re: [Wicket-user] AbortWithWebErrorCodeException not working as expected
I will look into it tomorrow... On 5/9/07, Johan Compagner [EMAIL PROTECTED] wrote: yes see our quickstart project in svn i can try to build an example for this for example if i change one of the wicket examples homepages that it throws such an exception does it fail then? johan On 5/9/07, Lowell Kirsh [EMAIL PROTECTED] wrote: do you have a quickstart that you can attach to a jira issue? What do you mean by this? Is a quickstart some sort of self-contained minimal jar? - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user