You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Milan Křápek <He...@seznam.cz> on 2008/06/11 10:50:53 UTC

How to send response without HTML code

 Hello, I have newbie question. 
  I am working on application that must be able to process two type of request. The users requests (send them some html pages in response) and server requests that expect only "HTTP/1.0 200 OK" or something similar with different return code.
  In my application I translate the URL called by server to some WebPage class. This is wrong because WebPage needs some HTML code on the response. And I get this exception : WicketMessage: Markup of type 'html' for component 'eu.optimsys.plm.pages.recorder.CreateCallRecord' not found.
  At first I try to find some parent of WebPage that does not need any HTML code. But I was not successful. Please can you give me advice how to get access to HTTP response and request before it gets to objects from wicket.markup package. I need something like wicket.http.Request but I am  not sure if something like this exists.

Thanks for any advice

Milan

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


Re: How to send response without HTML code

Posted by Peter Ertl <pe...@gmx.net>.
I think this is what AbortWithWebErrorCodeException is for

Am 11.06.2008 um 13:24 schrieb Erik van Oosten:

> Hi Milan,
>
> I think you should throw the exception AbortWithHttpStatusException.
>
> If you change your mind and want to set the HTTP status code, but  
> provide content as well, then call something like  
> ((WebResponse 
> )getResponse 
> ).getHttpServletResponse().setStatus(HttpServletResponse.SC_...) in  
> the constructor of your page.
>
> Regards,
>   Erik.
>
>
> Milan Křápek schreef:
>> Thanks for response but this is not th exact thing I want. I need  
>> to know the name of wicket component, where can I get access to  
>> request from user and fill the response for him. All I need is some  
>> parent class of WebPage. But this object must return just http code  
>> without any HTML. (I was not able to send response from WebPage  
>> without having any addititonal HTML file ).
>>
>> ---------------------------------------------------------------------
>> 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


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


Re: How to send response without HTML code

Posted by Erik van Oosten <e....@grons.nl>.
Hi Milan,

I think you should throw the exception AbortWithHttpStatusException.

If you change your mind and want to set the HTTP status code, but 
provide content as well, then call something like 
((WebResponse)getResponse).getHttpServletResponse().setStatus(HttpServletResponse.SC_...) 
in the constructor of your page.

Regards,
    Erik.


Milan Křápek schreef:
> Thanks for response but this is not th exact thing I want. I need to know the name of wicket component, where can I get access to request from user and fill the response for him. All I need is some parent class of WebPage. But this object must return just http code without any HTML. (I was not able to send response from WebPage without having any addititonal HTML file ).
>
> ---------------------------------------------------------------------
> 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: How to send response without HTML code

Posted by Milan Křápek <He...@seznam.cz>.
Thanks for response but this is not th exact thing I want. I need to know the name of wicket component, where can I get access to request from user and fill the response for him. All I need is some parent class of WebPage. But this object must return just http code without any HTML. (I was not able to send response from WebPage without having any addititonal HTML file ).

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


Re: How to send response without HTML code

Posted by Johan Compagner <jc...@gmail.com>.
See the request targets that set a http status code (cant remember the
exact name)

On 6/11/08, Milan Křápek <He...@seznam.cz> wrote:
>  Hello, I have newbie question.
>   I am working on application that must be able to process two type of
> request. The users requests (send them some html pages in response) and
> server requests that expect only "HTTP/1.0 200 OK" or something similar with
> different return code.
>   In my application I translate the URL called by server to some WebPage
> class. This is wrong because WebPage needs some HTML code on the response.
> And I get this exception : WicketMessage: Markup of type 'html' for
> component 'eu.optimsys.plm.pages.recorder.CreateCallRecord' not found.
>   At first I try to find some parent of WebPage that does not need any HTML
> code. But I was not successful. Please can you give me advice how to get
> access to HTTP response and request before it gets to objects from
> wicket.markup package. I need something like wicket.http.Request but I am
> not sure if something like this exists.
>
> Thanks for any advice
>
> Milan
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>