Changing the Content-Type of a Wicket Page

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Changing the Content-Type of a Wicket Page

Utku Somer
Hi,

I am trying to change the Content-Type of a wicket page. I have tried
this inside my page (extending WebPage), inside the constructor:



WebResponse webResponse = (WebResponse) getResponse();
HttpServletResponse response = webResponse.getHttpServletResponse();
response.setContentType("text/xml;charset=UTF-8");


but it did not work.

Any clues?

utku


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
Wicket-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/wicket-user
Reply | Threaded
Open this post in threaded view
|

Re: Changing the Content-Type of a Wicket Page

jdonnerstag
subclass Page.configureResponse(). But actually you don't need it.
Subclass Page.getMediaType() { return "xml"; } and your done. Wicket
knows the encoding already. Setting the encoding explicitly to UTF-8
may lead to problems later if you decide to change it.
ApplicationSettings.get/setDefaultEncoding() defines the default
encding to be used. Which is UTF-8 already.

Juergen

On 1/2/06, Utku Somer <[hidden email]> wrote:

> Hi,
>
> I am trying to change the Content-Type of a wicket page. I have tried
> this inside my page (extending WebPage), inside the constructor:
>
>
>
> WebResponse webResponse = (WebResponse) getResponse();
> HttpServletResponse response = webResponse.getHttpServletResponse();
> response.setContentType("text/xml;charset=UTF-8");
>
>
> but it did not work.
>
> Any clues?
>
> utku
>
>
> -------------------------------------------------------
> This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
> for problems?  Stop!  Download the new AJAX search engine that makes
> searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
> http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
> _______________________________________________
> Wicket-user mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/wicket-user
>


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
<a href="http://ads.osdn.com/?ad_idv37&alloc_id865&op=click">http://ads.osdn.com/?ad_idv37&alloc_id865&op=click
_______________________________________________
Wicket-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/wicket-user
Reply | Threaded
Open this post in threaded view
|

Re: Changing the Content-Type of a Wicket Page

Utku Somer
Juergen Donnerstag wrote:

>subclass Page.configureResponse(). But actually you don't need it.
>Subclass Page.getMediaType() { return "xml"; } and your done.
>
I do not see any getMediaType() method to override in Page or WebPage in
wicket 1.1.

utku


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
Wicket-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/wicket-user
Reply | Threaded
Open this post in threaded view
|

Re: Changing the Content-Type of a Wicket Page

jdonnerstag
Sorry, it is WebPage.getMarkupType() (and MarkupContaner.getMarkupType())

Juergen

On 1/2/06, Utku Somer <[hidden email]> wrote:

> Juergen Donnerstag wrote:
>
> >subclass Page.configureResponse(). But actually you don't need it.
> >Subclass Page.getMediaType() { return "xml"; } and your done.
> >
> I do not see any getMediaType() method to override in Page or WebPage in
> wicket 1.1.
>
> utku
>
>
> -------------------------------------------------------
> This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
> for problems?  Stop!  Download the new AJAX search engine that makes
> searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
> http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
> _______________________________________________
> Wicket-user mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/wicket-user
>


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
<a href="http://ads.osdn.com/?ad_idv37&alloc_id865&op=click">http://ads.osdn.com/?ad_idv37&alloc_id865&op=click
_______________________________________________
Wicket-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/wicket-user