You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Kenneth Holm Nielsen <ke...@gmail.com> on 2008/10/13 12:02:59 UTC

Encoding lsot when submitting a form on Tomcat 4.1.37

I'm using the wicket distribution for java 1.4 on a Tomcat 4.1.37,

my encoding to ISO-8859-1 is working fine until I submit a form.

The text 'æbleø' is presented fine until I submit, afterwards the encoding
for the entire document is lost and the text becomes 'æbleÃ',

in a BasePage.java that all pages implement I have configured the response
with ISO-8859-1 encoding.

    protected void configureResponse() {
        final String encoding = "text/html; charset=ISO-8859-1";

        getResponse().setContentType(encoding);
    }

On the BasePage.html I have added the following.

    <?xml version="1.0" encoding="ISO-8859-1"?>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "
http://www.w3.org/TR/html4/loose.dtd">
    <html lang="da">
        <head>
            <title wicket:id="pagetitle"></title>
            <meta http-equiv="Content-Type" content="text/html;
charset=ISO-8859-1">

The intial request, before submitting the form, has the correct Response
headers.

    url = http://localhost:8080/PGUI/?wicket:interface=:3::::
    Server: Apache-Coyote/1.1
    Content-Type: text/html;charset=ISO-8859-1
    Content-Length: 2241
    Date: Mon, 13 Oct 2008 09:36:00 GMT

but the Response from a submit does not set the content-type:

    url =
http://localhost:8080/PGUI/?wicket:interface=:3:form::IFormSubmitListener::
    Server: Apache-Coyote/1.1
    Location: http://localhost:8080/PGUI/?wicket:interface=:3::::
    Content-Length: 0
    Date: Mon, 13 Oct 2008 09:36:00 GMT

In the conf/server.xml in tomcat I've even added 'URIEncoding="*ISO-8859-1*"'
to the connector on port 8080.

Despite all these hints, the browsers IE 7 and firefox 3, won't recognize
the encoding.

What am I missing?

-- 
regards,

Kenneth Holm Nielsen

khAn Computing

http://www.kennethhn.dk
http://www.kennethhn.blogspot.com
http://www.linkedin.com/in/kennethhn

Re: Encoding lsot when submitting a form on Tomcat 4.1.37

Posted by Kenneth Holm Nielsen <ke...@gmail.com>.
I switched to using UTF-8 and all looks fine in the html.

There's still a problem with validation messages from property files, but I
guess that is a different issue,
thanks for your help! :)

On Mon, Oct 13, 2008 at 7:12 PM, Nino Saturnino Martinez Vazquez Wael <
nino.martinez@jayway.dk> wrote:

> Hi Kenneth
>
> I've seen on some occasions that IE 6 will loose content type if you
> specify UTF-8 as I remember it..
>
> And yeah why not use utf-8 ?
>
>
> Kenneth Holm Nielsen wrote:
>
>> Hehe, yeah I know,
>>
>> I forgot to mention that I also override init in Application like so:
>>
>>    protected void init() {
>>        this.getMarkupSettings().setDefaultMarkupEncoding("ISO-8859-1");
>>
>> I guess I'll just have to inform the customer that the chosen framework
>> does
>> not support latin-1.
>>
>> On Mon, Oct 13, 2008 at 3:23 PM, Johan Compagner <jcompagner@gmail.com
>> >wrote:
>>
>>
>>
>>> You shouldnt set the response like that i think. Please use the
>>> request setting default encoding. So that wicket also knows what you
>>> are using when the form comes back in (form submit)
>>>
>>> Why use that iso encoding, please, all the people of this world, start
>>> using only utf8 everywhere and drop all those other stupid encodings.
>>>
>>>
>>> On 10/13/08, Kenneth Holm Nielsen <ke...@gmail.com> wrote:
>>>
>>>
>>>> I'm using the wicket distribution for java 1.4 on a Tomcat 4.1.37,
>>>>
>>>> my encoding to ISO-8859-1 is working fine until I submit a form.
>>>>
>>>> The text 'æbleø' is presented fine until I submit, afterwards the
>>>>
>>>>
>>> encoding
>>>
>>>
>>>> for the entire document is lost and the text becomes 'æbleÃ',
>>>>
>>>> in a BasePage.java that all pages implement I have configured the
>>>>
>>>>
>>> response
>>>
>>>
>>>> with ISO-8859-1 encoding.
>>>>
>>>>    protected void configureResponse() {
>>>>        final String encoding = "text/html; charset=ISO-8859-1";
>>>>
>>>>        getResponse().setContentType(encoding);
>>>>    }
>>>>
>>>> On the BasePage.html I have added the following.
>>>>
>>>>    <?xml version="1.0" encoding="ISO-8859-1"?>
>>>>    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "
>>>> http://www.w3.org/TR/html4/loose.dtd">
>>>>    <html lang="da">
>>>>        <head>
>>>>            <title wicket:id="pagetitle"></title>
>>>>            <meta http-equiv="Content-Type" content="text/html;
>>>> charset=ISO-8859-1">
>>>>
>>>> The intial request, before submitting the form, has the correct Response
>>>> headers.
>>>>
>>>>    url = http://localhost:8080/PGUI/?wicket:interface=:3::::
>>>>    Server: Apache-Coyote/1.1
>>>>    Content-Type: text/html;charset=ISO-8859-1
>>>>    Content-Length: 2241
>>>>    Date: Mon, 13 Oct 2008 09:36:00 GMT
>>>>
>>>> but the Response from a submit does not set the content-type:
>>>>
>>>>    url =
>>>>
>>>>
>>>>
>>> http://localhost:8080/PGUI/?wicket:interface=:3:form::IFormSubmitListener
>>> ::
>>>
>>>
>>>>    Server: Apache-Coyote/1.1
>>>>    Location: http://localhost:8080/PGUI/?wicket:interface=:3::::
>>>>    Content-Length: 0
>>>>    Date: Mon, 13 Oct 2008 09:36:00 GMT
>>>>
>>>> In the conf/server.xml in tomcat I've even added
>>>> 'URIEncoding="*ISO-8859-1*"'
>>>> to the connector on port 8080.
>>>>
>>>> Despite all these hints, the browsers IE 7 and firefox 3, won't
>>>> recognize
>>>> the encoding.
>>>>
>>>> What am I missing?
>>>>
>>>> --
>>>> regards,
>>>>
>>>> Kenneth Holm Nielsen
>>>>
>>>> khAn Computing
>>>>
>>>> http://www.kennethhn.dk
>>>> http://www.kennethhn.blogspot.com
>>>> http://www.linkedin.com/in/kennethhn
>>>>
>>>>
>>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>
>>>
>>>
>>>
>>
>>
>>
>>
>
> --
> -Wicket for love
>
> Nino Martinez Wael
> Java Specialist @ Jayway DK
> http://www.jayway.dk
> +45 2936 7684
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>


-- 
regards,

Kenneth Holm Nielsen

khAn Computing
Phone.: +45 26 96 73 28

http://www.kennethhn.dk
http://www.kennethhn.blogspot.com
http://www.linkedin.com/in/kennethhn

Re: Encoding lsot when submitting a form on Tomcat 4.1.37

Posted by Nino Saturnino Martinez Vazquez Wael <ni...@jayway.dk>.
Hi Kenneth

I've seen on some occasions that IE 6 will loose content type if you 
specify UTF-8 as I remember it..

And yeah why not use utf-8 ?

Kenneth Holm Nielsen wrote:
> Hehe, yeah I know,
>
> I forgot to mention that I also override init in Application like so:
>
>     protected void init() {
>         this.getMarkupSettings().setDefaultMarkupEncoding("ISO-8859-1");
>
> I guess I'll just have to inform the customer that the chosen framework does
> not support latin-1.
>
> On Mon, Oct 13, 2008 at 3:23 PM, Johan Compagner <jc...@gmail.com>wrote:
>
>   
>> You shouldnt set the response like that i think. Please use the
>> request setting default encoding. So that wicket also knows what you
>> are using when the form comes back in (form submit)
>>
>> Why use that iso encoding, please, all the people of this world, start
>> using only utf8 everywhere and drop all those other stupid encodings.
>>
>>
>> On 10/13/08, Kenneth Holm Nielsen <ke...@gmail.com> wrote:
>>     
>>> I'm using the wicket distribution for java 1.4 on a Tomcat 4.1.37,
>>>
>>> my encoding to ISO-8859-1 is working fine until I submit a form.
>>>
>>> The text 'æbleø' is presented fine until I submit, afterwards the
>>>       
>> encoding
>>     
>>> for the entire document is lost and the text becomes 'æbleÃ',
>>>
>>> in a BasePage.java that all pages implement I have configured the
>>>       
>> response
>>     
>>> with ISO-8859-1 encoding.
>>>
>>>     protected void configureResponse() {
>>>         final String encoding = "text/html; charset=ISO-8859-1";
>>>
>>>         getResponse().setContentType(encoding);
>>>     }
>>>
>>> On the BasePage.html I have added the following.
>>>
>>>     <?xml version="1.0" encoding="ISO-8859-1"?>
>>>     <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "
>>> http://www.w3.org/TR/html4/loose.dtd">
>>>     <html lang="da">
>>>         <head>
>>>             <title wicket:id="pagetitle"></title>
>>>             <meta http-equiv="Content-Type" content="text/html;
>>> charset=ISO-8859-1">
>>>
>>> The intial request, before submitting the form, has the correct Response
>>> headers.
>>>
>>>     url = http://localhost:8080/PGUI/?wicket:interface=:3::::
>>>     Server: Apache-Coyote/1.1
>>>     Content-Type: text/html;charset=ISO-8859-1
>>>     Content-Length: 2241
>>>     Date: Mon, 13 Oct 2008 09:36:00 GMT
>>>
>>> but the Response from a submit does not set the content-type:
>>>
>>>     url =
>>>
>>>       
>> http://localhost:8080/PGUI/?wicket:interface=:3:form::IFormSubmitListener
>> ::
>>     
>>>     Server: Apache-Coyote/1.1
>>>     Location: http://localhost:8080/PGUI/?wicket:interface=:3::::
>>>     Content-Length: 0
>>>     Date: Mon, 13 Oct 2008 09:36:00 GMT
>>>
>>> In the conf/server.xml in tomcat I've even added
>>> 'URIEncoding="*ISO-8859-1*"'
>>> to the connector on port 8080.
>>>
>>> Despite all these hints, the browsers IE 7 and firefox 3, won't recognize
>>> the encoding.
>>>
>>> What am I missing?
>>>
>>> --
>>> regards,
>>>
>>> Kenneth Holm Nielsen
>>>
>>> khAn Computing
>>>
>>> http://www.kennethhn.dk
>>> http://www.kennethhn.blogspot.com
>>> http://www.linkedin.com/in/kennethhn
>>>
>>>       
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>>
>>     
>
>
>   

-- 
-Wicket for love

Nino Martinez Wael
Java Specialist @ Jayway DK
http://www.jayway.dk
+45 2936 7684


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


Re: Encoding lsot when submitting a form on Tomcat 4.1.37

Posted by Johan Compagner <jc...@gmail.com>.
That should work fine then. You shouldnt have to do that in your page configure.
What does the browser page info really give you back? Whay kind of
content type does the page have there?

By the way why does a client care about what content type is used?
(except that he could have a requirement that he wants to support any
character..)

Johan

On 10/13/08, Kenneth Holm Nielsen <ke...@gmail.com> wrote:
> Hehe, yeah I know,
>
> I forgot to mention that I also override init in Application like so:
>
>     protected void init() {
>         this.getMarkupSettings().setDefaultMarkupEncoding("ISO-8859-1");
>
> I guess I'll just have to inform the customer that the chosen framework does
> not support latin-1.
>
> On Mon, Oct 13, 2008 at 3:23 PM, Johan Compagner
> <jc...@gmail.com>wrote:
>
>> You shouldnt set the response like that i think. Please use the
>> request setting default encoding. So that wicket also knows what you
>> are using when the form comes back in (form submit)
>>
>> Why use that iso encoding, please, all the people of this world, start
>> using only utf8 everywhere and drop all those other stupid encodings.
>>
>>
>> On 10/13/08, Kenneth Holm Nielsen <ke...@gmail.com> wrote:
>> > I'm using the wicket distribution for java 1.4 on a Tomcat 4.1.37,
>> >
>> > my encoding to ISO-8859-1 is working fine until I submit a form.
>> >
>> > The text 'æbleø' is presented fine until I submit, afterwards the
>> encoding
>> > for the entire document is lost and the text becomes 'æbleÃ',
>> >
>> > in a BasePage.java that all pages implement I have configured the
>> response
>> > with ISO-8859-1 encoding.
>> >
>> >     protected void configureResponse() {
>> >         final String encoding = "text/html; charset=ISO-8859-1";
>> >
>> >         getResponse().setContentType(encoding);
>> >     }
>> >
>> > On the BasePage.html I have added the following.
>> >
>> >     <?xml version="1.0" encoding="ISO-8859-1"?>
>> >     <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "
>> > http://www.w3.org/TR/html4/loose.dtd">
>> >     <html lang="da">
>> >         <head>
>> >             <title wicket:id="pagetitle"></title>
>> >             <meta http-equiv="Content-Type" content="text/html;
>> > charset=ISO-8859-1">
>> >
>> > The intial request, before submitting the form, has the correct Response
>> > headers.
>> >
>> >     url = http://localhost:8080/PGUI/?wicket:interface=:3::::
>> >     Server: Apache-Coyote/1.1
>> >     Content-Type: text/html;charset=ISO-8859-1
>> >     Content-Length: 2241
>> >     Date: Mon, 13 Oct 2008 09:36:00 GMT
>> >
>> > but the Response from a submit does not set the content-type:
>> >
>> >     url =
>> >
>> http://localhost:8080/PGUI/?wicket:interface=:3:form::IFormSubmitListener
>> ::
>> >     Server: Apache-Coyote/1.1
>> >     Location: http://localhost:8080/PGUI/?wicket:interface=:3::::
>> >     Content-Length: 0
>> >     Date: Mon, 13 Oct 2008 09:36:00 GMT
>> >
>> > In the conf/server.xml in tomcat I've even added
>> > 'URIEncoding="*ISO-8859-1*"'
>> > to the connector on port 8080.
>> >
>> > Despite all these hints, the browsers IE 7 and firefox 3, won't
>> > recognize
>> > the encoding.
>> >
>> > What am I missing?
>> >
>> > --
>> > regards,
>> >
>> > Kenneth Holm Nielsen
>> >
>> > khAn Computing
>> >
>> > http://www.kennethhn.dk
>> > http://www.kennethhn.blogspot.com
>> > http://www.linkedin.com/in/kennethhn
>> >
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>>
>
>
> --
> regards,
>
> Kenneth Holm Nielsen
>
> khAn Computing
>
> http://www.kennethhn.dk
> http://www.kennethhn.blogspot.com
> http://www.linkedin.com/in/kennethhn
>

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


Re: Encoding lsot when submitting a form on Tomcat 4.1.37

Posted by Kenneth Holm Nielsen <ke...@gmail.com>.
Hehe, yeah I know,

I forgot to mention that I also override init in Application like so:

    protected void init() {
        this.getMarkupSettings().setDefaultMarkupEncoding("ISO-8859-1");

I guess I'll just have to inform the customer that the chosen framework does
not support latin-1.

On Mon, Oct 13, 2008 at 3:23 PM, Johan Compagner <jc...@gmail.com>wrote:

> You shouldnt set the response like that i think. Please use the
> request setting default encoding. So that wicket also knows what you
> are using when the form comes back in (form submit)
>
> Why use that iso encoding, please, all the people of this world, start
> using only utf8 everywhere and drop all those other stupid encodings.
>
>
> On 10/13/08, Kenneth Holm Nielsen <ke...@gmail.com> wrote:
> > I'm using the wicket distribution for java 1.4 on a Tomcat 4.1.37,
> >
> > my encoding to ISO-8859-1 is working fine until I submit a form.
> >
> > The text 'æbleø' is presented fine until I submit, afterwards the
> encoding
> > for the entire document is lost and the text becomes 'æbleÃ',
> >
> > in a BasePage.java that all pages implement I have configured the
> response
> > with ISO-8859-1 encoding.
> >
> >     protected void configureResponse() {
> >         final String encoding = "text/html; charset=ISO-8859-1";
> >
> >         getResponse().setContentType(encoding);
> >     }
> >
> > On the BasePage.html I have added the following.
> >
> >     <?xml version="1.0" encoding="ISO-8859-1"?>
> >     <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "
> > http://www.w3.org/TR/html4/loose.dtd">
> >     <html lang="da">
> >         <head>
> >             <title wicket:id="pagetitle"></title>
> >             <meta http-equiv="Content-Type" content="text/html;
> > charset=ISO-8859-1">
> >
> > The intial request, before submitting the form, has the correct Response
> > headers.
> >
> >     url = http://localhost:8080/PGUI/?wicket:interface=:3::::
> >     Server: Apache-Coyote/1.1
> >     Content-Type: text/html;charset=ISO-8859-1
> >     Content-Length: 2241
> >     Date: Mon, 13 Oct 2008 09:36:00 GMT
> >
> > but the Response from a submit does not set the content-type:
> >
> >     url =
> >
> http://localhost:8080/PGUI/?wicket:interface=:3:form::IFormSubmitListener
> ::
> >     Server: Apache-Coyote/1.1
> >     Location: http://localhost:8080/PGUI/?wicket:interface=:3::::
> >     Content-Length: 0
> >     Date: Mon, 13 Oct 2008 09:36:00 GMT
> >
> > In the conf/server.xml in tomcat I've even added
> > 'URIEncoding="*ISO-8859-1*"'
> > to the connector on port 8080.
> >
> > Despite all these hints, the browsers IE 7 and firefox 3, won't recognize
> > the encoding.
> >
> > What am I missing?
> >
> > --
> > regards,
> >
> > Kenneth Holm Nielsen
> >
> > khAn Computing
> >
> > http://www.kennethhn.dk
> > http://www.kennethhn.blogspot.com
> > http://www.linkedin.com/in/kennethhn
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>


-- 
regards,

Kenneth Holm Nielsen

khAn Computing

http://www.kennethhn.dk
http://www.kennethhn.blogspot.com
http://www.linkedin.com/in/kennethhn

Re: Encoding lsot when submitting a form on Tomcat 4.1.37

Posted by Johan Compagner <jc...@gmail.com>.
You shouldnt set the response like that i think. Please use the
request setting default encoding. So that wicket also knows what you
are using when the form comes back in (form submit)

Why use that iso encoding, please, all the people of this world, start
using only utf8 everywhere and drop all those other stupid encodings.


On 10/13/08, Kenneth Holm Nielsen <ke...@gmail.com> wrote:
> I'm using the wicket distribution for java 1.4 on a Tomcat 4.1.37,
>
> my encoding to ISO-8859-1 is working fine until I submit a form.
>
> The text 'æbleø' is presented fine until I submit, afterwards the encoding
> for the entire document is lost and the text becomes 'æbleÃ',
>
> in a BasePage.java that all pages implement I have configured the response
> with ISO-8859-1 encoding.
>
>     protected void configureResponse() {
>         final String encoding = "text/html; charset=ISO-8859-1";
>
>         getResponse().setContentType(encoding);
>     }
>
> On the BasePage.html I have added the following.
>
>     <?xml version="1.0" encoding="ISO-8859-1"?>
>     <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "
> http://www.w3.org/TR/html4/loose.dtd">
>     <html lang="da">
>         <head>
>             <title wicket:id="pagetitle"></title>
>             <meta http-equiv="Content-Type" content="text/html;
> charset=ISO-8859-1">
>
> The intial request, before submitting the form, has the correct Response
> headers.
>
>     url = http://localhost:8080/PGUI/?wicket:interface=:3::::
>     Server: Apache-Coyote/1.1
>     Content-Type: text/html;charset=ISO-8859-1
>     Content-Length: 2241
>     Date: Mon, 13 Oct 2008 09:36:00 GMT
>
> but the Response from a submit does not set the content-type:
>
>     url =
> http://localhost:8080/PGUI/?wicket:interface=:3:form::IFormSubmitListener::
>     Server: Apache-Coyote/1.1
>     Location: http://localhost:8080/PGUI/?wicket:interface=:3::::
>     Content-Length: 0
>     Date: Mon, 13 Oct 2008 09:36:00 GMT
>
> In the conf/server.xml in tomcat I've even added
> 'URIEncoding="*ISO-8859-1*"'
> to the connector on port 8080.
>
> Despite all these hints, the browsers IE 7 and firefox 3, won't recognize
> the encoding.
>
> What am I missing?
>
> --
> regards,
>
> Kenneth Holm Nielsen
>
> khAn Computing
>
> http://www.kennethhn.dk
> http://www.kennethhn.blogspot.com
> http://www.linkedin.com/in/kennethhn
>

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