I get it. On Wed, Feb 11, 2009 at 12:01 AM, Igor Vaynberg <igor.vaynb...@gmail.com> wrote: > do you get 500 or do you not? > > -igor > > On Tue, Feb 10, 2009 at 8:57 AM, Anton Veretennikov > <anton.veretenni...@gmail.com> wrote: >>> should be fine, you can throw any kind of runtime exception you want. >>> >>> -igor >> >> Igor, thank you for answer. >> >> Did you mean that "HTTP Status 500 error" I get is not what it must be? >> It's a bug or what? I can make jira if it is so. >> >> -- Tony >> >>> On Mon, Feb 9, 2009 at 11:57 PM, Anton Veretennikov >>> <anton.veretenni...@gmail.com> wrote: >>>> Hello, all wicket users! >>>> >>>> I receive HTTP Status 500 error in this situation: >>>> >>>> I have a page with empty html-file and page's onRender() looks like: >>>> >>>> OutputStreamWriter writer = null; >>>> try { >>>> writer = new OutputStreamWriter(getResponse().getOutputStream(), >>>> encoding); >>>> String enc = getRequestCycle().getResponse().getCharacterEncoding(); >>>> writer.append("<!--" + enc + "-->\n"); >>>> writer.append("....."); >>>> } catch (UnsupportedEncodingException ex) { >>>> throw new WicketRuntimeException("Invalid charset: " + >>>> ex.getMessage()); >>>> } catch (IOException ex) { >>>> throw new WicketRuntimeException("IOException: " + ex.getMessage()); >>>> } finally { >>>> if (writer != null) { >>>> try { >>>> writer.close(); >>>> } catch (IOException ex) { >>>> } >>>> } >>>> } >>>> >>>> >>>> The problem is when this first catch is reached (because encoding >>>> desired is sent as a parameter that could be errouneous) and >>>> >>>> new WicketRuntimeException("Invalid charset: " + ex.getMessage()); >>>> >>>> is thrown I see HTTP Status 500 error with this: >>>> >>>> ERROR - WicketFilter - closing the buffer error >>>> java.lang.IllegalStateException: getOutputStream() has already been >>>> called for this response >>>> at >>>> org.apache.catalina.connector.Response.getWriter(Response.java:610) >>>> at >>>> org.apache.catalina.connector.ResponseFacade.getWriter(ResponseFacade.java:198) >>>> at >>>> org.apache.wicket.protocol.http.WebResponse.write(WebResponse.java:365) >>>> at >>>> org.apache.wicket.protocol.http.BufferedWebResponse.close(BufferedWebResponse.java:73) >>>> at >>>> org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:471) >>>> at >>>> org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:288) >>>> >>>> I would like to know is it proper to throw WicketRuntimeException in >>>> such situation. >>>> For example I want to show standart Wicket Error page. >>>> >>>> Thank you very much. >>>> >>>> -- Tony >>>> >>>> --------------------------------------------------------------------- >>>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org >>>> For additional commands, e-mail: users-h...@wicket.apache.org >>>> >>>> >>> >>> --------------------------------------------------------------------- >>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org >>> For additional commands, e-mail: users-h...@wicket.apache.org >>> >>> >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org >> For additional commands, e-mail: users-h...@wicket.apache.org >> >> > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > For additional commands, e-mail: users-h...@wicket.apache.org > >
--------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org