You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Evgeniy Karyakin (JIRA)" <ji...@apache.org> on 2007/12/18 10:47:43 UTC

[jira] Created: (WICKET-1235) First-time request doesn't respect XML page and Form encoding

First-time request doesn't respect XML page and Form encoding
-------------------------------------------------------------

                 Key: WICKET-1235
                 URL: https://issues.apache.org/jira/browse/WICKET-1235
             Project: Wicket
          Issue Type: Bug
          Components: wicket
    Affects Versions: 1.3.0-rc2
         Environment: Windows 2000, jdk1.4.2_14-b05, Apache Tomcat 4.1.36-LE, Wicket 1.3.0-rc2
            Reporter: Evgeniy Karyakin


One test page with <?xml version="1.0" encoding="UTF-8"?> XML declaration in it (Wicket13TestHomePage.html):

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html
    PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns:wicket="http://wicket.sourceforge.net/">
<head>
<title>Wicket13Test</title>
</head>
<body>
<!-- Form in question -->
<form wicket:id="testform" accept-charset="UTF-8">
<input type="text" wicket:id="inputtest"/>
<input type="submit"/>
</form>
<!-- /Form -->
</body>
</html>

WebApplication implementation set application-wide response-request encoding to UTF-8:

package com.example.wicket13test;
import org.apache.wicket.protocol.http.WebApplication;
public class Wicket13TestApplication extends WebApplication {
	public Wicket13TestApplication() {
	}
	public Class getHomePage() {
		return Wicket13TestHomePage.class;
	}
	public void init() {
		super.init();
		getRequestCycleSettings().setResponseRequestEncoding("UTF-8");
	}
}

FIRST browser request of http://localhost/Wicket13Test/ gives this response headers:

HTTP/1.x 200 OK
Server: Apache-Coyote/1.1
Pragma: no-cache
Cache-Control: no-cache, max-age=0, must-revalidate
Content-Type: text/html;charset=ISO-8859-5
Content-Language: ru-RU
Content-Length: 638
Date: Tue, 18 Dec 2007 09:31:04 GMT

That is, Content-Type is ISO-8859-5 (JVM's default?), but I assume it should already be UTF-8. Second and consequent requests result in proper response encoding: "Content-Type: text/html;charset=UTF-8". Hands-on web experience says that browser makes form submission using character encoding based on last response's setting. So this situation leads to wrong *first-time* form submission, but second ones are fine. In Firefox 2 form's accept-charset attributes helps forcibly set desired encoding, but in MSIE it doesn't.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (WICKET-1235) First-time request doesn't respect XML page and Form encoding

Posted by "Juergen Donnerstag (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-1235?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12584505#action_12584505 ] 

Juergen Donnerstag commented on WICKET-1235:
--------------------------------------------

I agree with Johan. If it is a Tomcat 4 problem, than we are not able to fix it. I tested it with Jetty and Tomcat 5 and it working.

> First-time request doesn't respect XML page and Form encoding
> -------------------------------------------------------------
>
>                 Key: WICKET-1235
>                 URL: https://issues.apache.org/jira/browse/WICKET-1235
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.3.0-rc2
>         Environment: Windows 2000, jdk1.4.2_14-b05, Apache Tomcat 4.1.36-LE, Wicket 1.3.0-rc2
>            Reporter: Evgeniy Karyakin
>            Assignee: Juergen Donnerstag
>             Fix For: 1.3.3
>
>         Attachments: Wicket13Test.jar, Wicket13Test.war
>
>
> One test page with <?xml version="1.0" encoding="UTF-8"?> XML declaration in it (Wicket13TestHomePage.html):
> <?xml version="1.0" encoding="UTF-8"?>
> <!DOCTYPE html
>     PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
>     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
> <html xmlns:wicket="http://wicket.sourceforge.net/">
> <head>
> <title>Wicket13Test</title>
> </head>
> <body>
> <!-- Form in question -->
> <form wicket:id="testform" accept-charset="UTF-8">
> <input type="text" wicket:id="inputtest"/>
> <input type="submit"/>
> </form>
> <!-- /Form -->
> </body>
> </html>
> WebApplication implementation set application-wide response-request encoding to UTF-8:
> package com.example.wicket13test;
> import org.apache.wicket.protocol.http.WebApplication;
> public class Wicket13TestApplication extends WebApplication {
> 	public Wicket13TestApplication() {
> 	}
> 	public Class getHomePage() {
> 		return Wicket13TestHomePage.class;
> 	}
> 	public void init() {
> 		super.init();
> 		getRequestCycleSettings().setResponseRequestEncoding("UTF-8");
> 	}
> }
> FIRST browser request of http://localhost/Wicket13Test/ gives this response headers:
> HTTP/1.x 200 OK
> Server: Apache-Coyote/1.1
> Pragma: no-cache
> Cache-Control: no-cache, max-age=0, must-revalidate
> Content-Type: text/html;charset=ISO-8859-5
> Content-Language: ru-RU
> Content-Length: 638
> Date: Tue, 18 Dec 2007 09:31:04 GMT
> That is, Content-Type is ISO-8859-5 (JVM's default?), but I assume it should already be UTF-8. Second and consequent requests result in proper response encoding: "Content-Type: text/html;charset=UTF-8". Hands-on web experience says that browser makes form submission using character encoding based on last response's setting. So this situation leads to wrong *first-time* form submission, but second ones are fine. In Firefox 2 form's accept-charset attributes helps forcibly set desired encoding, but in MSIE it doesn't.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Issue Comment Edited: (WICKET-1235) First-time request doesn't respect XML page and Form encoding

Posted by "Evgeniy Karyakin (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-1235?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12559403#action_12559403 ] 

unchqua edited comment on WICKET-1235 at 1/16/08 1:15 AM:
-------------------------------------------------------------------

This is latest test results for this issue, using freshly-released Wicket 1.3: it appears that Tomcat 4 (more precise 4.1.36-LE) has something related to this problem. Exactly the same test WAR file works well in Tomcat 5.5.20 (reports UTF-8 encoding after first-time application home page request), but 4th Tomcat version states ISO-8859-5 encoding in HTTP response header, so we can say Wicket 1.3 is affected. No programmatic manipulation is done in Java code, only HTML page contains <?xml ... encoding="UTF-8" ... ?> declaration.

      was (Author: unchqua):
    This is latest test results for this issue: it appears that Tomcat 4 (more precise 4.1.36-LE) has something related to this problem. Exactly the same test WAR file works well in Tomcat 5.5.20 (reports UTF-8 encoding after first-time application home page request), but 4th Tomcat version states ISO-8859-5 encoding in HTTP response header, so we can say Wicket 1.3 is affected. No programmatic manipulation is done in Java code, only HTML page contains <?xml ... encoding="UTF-8" ... ?> declaration.
  
> First-time request doesn't respect XML page and Form encoding
> -------------------------------------------------------------
>
>                 Key: WICKET-1235
>                 URL: https://issues.apache.org/jira/browse/WICKET-1235
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.3.0-rc2
>         Environment: Windows 2000, jdk1.4.2_14-b05, Apache Tomcat 4.1.36-LE, Wicket 1.3.0-rc2
>            Reporter: Evgeniy Karyakin
>         Attachments: Wicket13Test.jar, Wicket13Test.war
>
>
> One test page with <?xml version="1.0" encoding="UTF-8"?> XML declaration in it (Wicket13TestHomePage.html):
> <?xml version="1.0" encoding="UTF-8"?>
> <!DOCTYPE html
>     PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
>     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
> <html xmlns:wicket="http://wicket.sourceforge.net/">
> <head>
> <title>Wicket13Test</title>
> </head>
> <body>
> <!-- Form in question -->
> <form wicket:id="testform" accept-charset="UTF-8">
> <input type="text" wicket:id="inputtest"/>
> <input type="submit"/>
> </form>
> <!-- /Form -->
> </body>
> </html>
> WebApplication implementation set application-wide response-request encoding to UTF-8:
> package com.example.wicket13test;
> import org.apache.wicket.protocol.http.WebApplication;
> public class Wicket13TestApplication extends WebApplication {
> 	public Wicket13TestApplication() {
> 	}
> 	public Class getHomePage() {
> 		return Wicket13TestHomePage.class;
> 	}
> 	public void init() {
> 		super.init();
> 		getRequestCycleSettings().setResponseRequestEncoding("UTF-8");
> 	}
> }
> FIRST browser request of http://localhost/Wicket13Test/ gives this response headers:
> HTTP/1.x 200 OK
> Server: Apache-Coyote/1.1
> Pragma: no-cache
> Cache-Control: no-cache, max-age=0, must-revalidate
> Content-Type: text/html;charset=ISO-8859-5
> Content-Language: ru-RU
> Content-Length: 638
> Date: Tue, 18 Dec 2007 09:31:04 GMT
> That is, Content-Type is ISO-8859-5 (JVM's default?), but I assume it should already be UTF-8. Second and consequent requests result in proper response encoding: "Content-Type: text/html;charset=UTF-8". Hands-on web experience says that browser makes form submission using character encoding based on last response's setting. So this situation leads to wrong *first-time* form submission, but second ones are fine. In Firefox 2 form's accept-charset attributes helps forcibly set desired encoding, but in MSIE it doesn't.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (WICKET-1235) First-time request doesn't respect XML page and Form encoding

Posted by "Johan Compagner (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WICKET-1235?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Johan Compagner updated WICKET-1235:
------------------------------------

    Fix Version/s: 1.3.3
         Assignee: Juergen Donnerstag

> First-time request doesn't respect XML page and Form encoding
> -------------------------------------------------------------
>
>                 Key: WICKET-1235
>                 URL: https://issues.apache.org/jira/browse/WICKET-1235
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.3.0-rc2
>         Environment: Windows 2000, jdk1.4.2_14-b05, Apache Tomcat 4.1.36-LE, Wicket 1.3.0-rc2
>            Reporter: Evgeniy Karyakin
>            Assignee: Juergen Donnerstag
>             Fix For: 1.3.3
>
>         Attachments: Wicket13Test.jar, Wicket13Test.war
>
>
> One test page with <?xml version="1.0" encoding="UTF-8"?> XML declaration in it (Wicket13TestHomePage.html):
> <?xml version="1.0" encoding="UTF-8"?>
> <!DOCTYPE html
>     PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
>     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
> <html xmlns:wicket="http://wicket.sourceforge.net/">
> <head>
> <title>Wicket13Test</title>
> </head>
> <body>
> <!-- Form in question -->
> <form wicket:id="testform" accept-charset="UTF-8">
> <input type="text" wicket:id="inputtest"/>
> <input type="submit"/>
> </form>
> <!-- /Form -->
> </body>
> </html>
> WebApplication implementation set application-wide response-request encoding to UTF-8:
> package com.example.wicket13test;
> import org.apache.wicket.protocol.http.WebApplication;
> public class Wicket13TestApplication extends WebApplication {
> 	public Wicket13TestApplication() {
> 	}
> 	public Class getHomePage() {
> 		return Wicket13TestHomePage.class;
> 	}
> 	public void init() {
> 		super.init();
> 		getRequestCycleSettings().setResponseRequestEncoding("UTF-8");
> 	}
> }
> FIRST browser request of http://localhost/Wicket13Test/ gives this response headers:
> HTTP/1.x 200 OK
> Server: Apache-Coyote/1.1
> Pragma: no-cache
> Cache-Control: no-cache, max-age=0, must-revalidate
> Content-Type: text/html;charset=ISO-8859-5
> Content-Language: ru-RU
> Content-Length: 638
> Date: Tue, 18 Dec 2007 09:31:04 GMT
> That is, Content-Type is ISO-8859-5 (JVM's default?), but I assume it should already be UTF-8. Second and consequent requests result in proper response encoding: "Content-Type: text/html;charset=UTF-8". Hands-on web experience says that browser makes form submission using character encoding based on last response's setting. So this situation leads to wrong *first-time* form submission, but second ones are fine. In Firefox 2 form's accept-charset attributes helps forcibly set desired encoding, but in MSIE it doesn't.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (WICKET-1235) First-time request doesn't respect XML page and Form encoding

Posted by "Evgeniy Karyakin (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-1235?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12559403#action_12559403 ] 

Evgeniy Karyakin commented on WICKET-1235:
------------------------------------------

This is latest test results for this issue: it appears that Tomcat 4 (more precise 4.1.36-LE) has something related to this problem. Exactly the same test WAR file works well in Tomcat 5.5.20 (reports UTF-8 encoding after first-time application home page request), but 4th Tomcat version states ISO-8859-5 encoding in HTTP response header, so we can say Wicket 1.3 is affected. No programmatic manipulation is done in Java code, only HTML page contains <?xml ... encoding="UTF-8" ... ?> declaration.

> First-time request doesn't respect XML page and Form encoding
> -------------------------------------------------------------
>
>                 Key: WICKET-1235
>                 URL: https://issues.apache.org/jira/browse/WICKET-1235
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.3.0-rc2
>         Environment: Windows 2000, jdk1.4.2_14-b05, Apache Tomcat 4.1.36-LE, Wicket 1.3.0-rc2
>            Reporter: Evgeniy Karyakin
>         Attachments: Wicket13Test.jar, Wicket13Test.war
>
>
> One test page with <?xml version="1.0" encoding="UTF-8"?> XML declaration in it (Wicket13TestHomePage.html):
> <?xml version="1.0" encoding="UTF-8"?>
> <!DOCTYPE html
>     PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
>     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
> <html xmlns:wicket="http://wicket.sourceforge.net/">
> <head>
> <title>Wicket13Test</title>
> </head>
> <body>
> <!-- Form in question -->
> <form wicket:id="testform" accept-charset="UTF-8">
> <input type="text" wicket:id="inputtest"/>
> <input type="submit"/>
> </form>
> <!-- /Form -->
> </body>
> </html>
> WebApplication implementation set application-wide response-request encoding to UTF-8:
> package com.example.wicket13test;
> import org.apache.wicket.protocol.http.WebApplication;
> public class Wicket13TestApplication extends WebApplication {
> 	public Wicket13TestApplication() {
> 	}
> 	public Class getHomePage() {
> 		return Wicket13TestHomePage.class;
> 	}
> 	public void init() {
> 		super.init();
> 		getRequestCycleSettings().setResponseRequestEncoding("UTF-8");
> 	}
> }
> FIRST browser request of http://localhost/Wicket13Test/ gives this response headers:
> HTTP/1.x 200 OK
> Server: Apache-Coyote/1.1
> Pragma: no-cache
> Cache-Control: no-cache, max-age=0, must-revalidate
> Content-Type: text/html;charset=ISO-8859-5
> Content-Language: ru-RU
> Content-Length: 638
> Date: Tue, 18 Dec 2007 09:31:04 GMT
> That is, Content-Type is ISO-8859-5 (JVM's default?), but I assume it should already be UTF-8. Second and consequent requests result in proper response encoding: "Content-Type: text/html;charset=UTF-8". Hands-on web experience says that browser makes form submission using character encoding based on last response's setting. So this situation leads to wrong *first-time* form submission, but second ones are fine. In Firefox 2 form's accept-charset attributes helps forcibly set desired encoding, but in MSIE it doesn't.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (WICKET-1235) First-time request doesn't respect XML page and Form encoding

Posted by "Evgeniy Karyakin (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WICKET-1235?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Evgeniy Karyakin updated WICKET-1235:
-------------------------------------

    Attachment: Wicket13Test.war

WAR file with simple web.xml. Placed into webapps .

> First-time request doesn't respect XML page and Form encoding
> -------------------------------------------------------------
>
>                 Key: WICKET-1235
>                 URL: https://issues.apache.org/jira/browse/WICKET-1235
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.3.0-rc2
>         Environment: Windows 2000, jdk1.4.2_14-b05, Apache Tomcat 4.1.36-LE, Wicket 1.3.0-rc2
>            Reporter: Evgeniy Karyakin
>         Attachments: Wicket13Test.jar, Wicket13Test.war
>
>
> One test page with <?xml version="1.0" encoding="UTF-8"?> XML declaration in it (Wicket13TestHomePage.html):
> <?xml version="1.0" encoding="UTF-8"?>
> <!DOCTYPE html
>     PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
>     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
> <html xmlns:wicket="http://wicket.sourceforge.net/">
> <head>
> <title>Wicket13Test</title>
> </head>
> <body>
> <!-- Form in question -->
> <form wicket:id="testform" accept-charset="UTF-8">
> <input type="text" wicket:id="inputtest"/>
> <input type="submit"/>
> </form>
> <!-- /Form -->
> </body>
> </html>
> WebApplication implementation set application-wide response-request encoding to UTF-8:
> package com.example.wicket13test;
> import org.apache.wicket.protocol.http.WebApplication;
> public class Wicket13TestApplication extends WebApplication {
> 	public Wicket13TestApplication() {
> 	}
> 	public Class getHomePage() {
> 		return Wicket13TestHomePage.class;
> 	}
> 	public void init() {
> 		super.init();
> 		getRequestCycleSettings().setResponseRequestEncoding("UTF-8");
> 	}
> }
> FIRST browser request of http://localhost/Wicket13Test/ gives this response headers:
> HTTP/1.x 200 OK
> Server: Apache-Coyote/1.1
> Pragma: no-cache
> Cache-Control: no-cache, max-age=0, must-revalidate
> Content-Type: text/html;charset=ISO-8859-5
> Content-Language: ru-RU
> Content-Length: 638
> Date: Tue, 18 Dec 2007 09:31:04 GMT
> That is, Content-Type is ISO-8859-5 (JVM's default?), but I assume it should already be UTF-8. Second and consequent requests result in proper response encoding: "Content-Type: text/html;charset=UTF-8". Hands-on web experience says that browser makes form submission using character encoding based on last response's setting. So this situation leads to wrong *first-time* form submission, but second ones are fine. In Firefox 2 form's accept-charset attributes helps forcibly set desired encoding, but in MSIE it doesn't.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (WICKET-1235) First-time request doesn't respect XML page and Form encoding

Posted by "Juergen Donnerstag (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-1235?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12552885 ] 

Juergen Donnerstag commented on WICKET-1235:
--------------------------------------------

Using any of my apps or the wicket example apps, I'm not able to reproduce it with FF (validating with firebug plugin)

BTW: setResponseRequestEncoding("UTF-8") is the default. No need to set it explicitly

> First-time request doesn't respect XML page and Form encoding
> -------------------------------------------------------------
>
>                 Key: WICKET-1235
>                 URL: https://issues.apache.org/jira/browse/WICKET-1235
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.3.0-rc2
>         Environment: Windows 2000, jdk1.4.2_14-b05, Apache Tomcat 4.1.36-LE, Wicket 1.3.0-rc2
>            Reporter: Evgeniy Karyakin
>         Attachments: Wicket13Test.jar, Wicket13Test.war
>
>
> One test page with <?xml version="1.0" encoding="UTF-8"?> XML declaration in it (Wicket13TestHomePage.html):
> <?xml version="1.0" encoding="UTF-8"?>
> <!DOCTYPE html
>     PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
>     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
> <html xmlns:wicket="http://wicket.sourceforge.net/">
> <head>
> <title>Wicket13Test</title>
> </head>
> <body>
> <!-- Form in question -->
> <form wicket:id="testform" accept-charset="UTF-8">
> <input type="text" wicket:id="inputtest"/>
> <input type="submit"/>
> </form>
> <!-- /Form -->
> </body>
> </html>
> WebApplication implementation set application-wide response-request encoding to UTF-8:
> package com.example.wicket13test;
> import org.apache.wicket.protocol.http.WebApplication;
> public class Wicket13TestApplication extends WebApplication {
> 	public Wicket13TestApplication() {
> 	}
> 	public Class getHomePage() {
> 		return Wicket13TestHomePage.class;
> 	}
> 	public void init() {
> 		super.init();
> 		getRequestCycleSettings().setResponseRequestEncoding("UTF-8");
> 	}
> }
> FIRST browser request of http://localhost/Wicket13Test/ gives this response headers:
> HTTP/1.x 200 OK
> Server: Apache-Coyote/1.1
> Pragma: no-cache
> Cache-Control: no-cache, max-age=0, must-revalidate
> Content-Type: text/html;charset=ISO-8859-5
> Content-Language: ru-RU
> Content-Length: 638
> Date: Tue, 18 Dec 2007 09:31:04 GMT
> That is, Content-Type is ISO-8859-5 (JVM's default?), but I assume it should already be UTF-8. Second and consequent requests result in proper response encoding: "Content-Type: text/html;charset=UTF-8". Hands-on web experience says that browser makes form submission using character encoding based on last response's setting. So this situation leads to wrong *first-time* form submission, but second ones are fine. In Firefox 2 form's accept-charset attributes helps forcibly set desired encoding, but in MSIE it doesn't.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (WICKET-1235) First-time request doesn't respect XML page and Form encoding

Posted by "Evgeniy Karyakin (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-1235?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12552685 ] 

Evgeniy Karyakin commented on WICKET-1235:
------------------------------------------

BTW, I also use Tomcat's standard servlet filter filters.SetCharacterEncodingFilter taken from its examples.

> First-time request doesn't respect XML page and Form encoding
> -------------------------------------------------------------
>
>                 Key: WICKET-1235
>                 URL: https://issues.apache.org/jira/browse/WICKET-1235
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.3.0-rc2
>         Environment: Windows 2000, jdk1.4.2_14-b05, Apache Tomcat 4.1.36-LE, Wicket 1.3.0-rc2
>            Reporter: Evgeniy Karyakin
>         Attachments: Wicket13Test.jar, Wicket13Test.war
>
>
> One test page with <?xml version="1.0" encoding="UTF-8"?> XML declaration in it (Wicket13TestHomePage.html):
> <?xml version="1.0" encoding="UTF-8"?>
> <!DOCTYPE html
>     PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
>     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
> <html xmlns:wicket="http://wicket.sourceforge.net/">
> <head>
> <title>Wicket13Test</title>
> </head>
> <body>
> <!-- Form in question -->
> <form wicket:id="testform" accept-charset="UTF-8">
> <input type="text" wicket:id="inputtest"/>
> <input type="submit"/>
> </form>
> <!-- /Form -->
> </body>
> </html>
> WebApplication implementation set application-wide response-request encoding to UTF-8:
> package com.example.wicket13test;
> import org.apache.wicket.protocol.http.WebApplication;
> public class Wicket13TestApplication extends WebApplication {
> 	public Wicket13TestApplication() {
> 	}
> 	public Class getHomePage() {
> 		return Wicket13TestHomePage.class;
> 	}
> 	public void init() {
> 		super.init();
> 		getRequestCycleSettings().setResponseRequestEncoding("UTF-8");
> 	}
> }
> FIRST browser request of http://localhost/Wicket13Test/ gives this response headers:
> HTTP/1.x 200 OK
> Server: Apache-Coyote/1.1
> Pragma: no-cache
> Cache-Control: no-cache, max-age=0, must-revalidate
> Content-Type: text/html;charset=ISO-8859-5
> Content-Language: ru-RU
> Content-Length: 638
> Date: Tue, 18 Dec 2007 09:31:04 GMT
> That is, Content-Type is ISO-8859-5 (JVM's default?), but I assume it should already be UTF-8. Second and consequent requests result in proper response encoding: "Content-Type: text/html;charset=UTF-8". Hands-on web experience says that browser makes form submission using character encoding based on last response's setting. So this situation leads to wrong *first-time* form submission, but second ones are fine. In Firefox 2 form's accept-charset attributes helps forcibly set desired encoding, but in MSIE it doesn't.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (WICKET-1235) First-time request doesn't respect XML page and Form encoding

Posted by "Frank Bille Jensen (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WICKET-1235?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Frank Bille Jensen updated WICKET-1235:
---------------------------------------

    Fix Version/s:     (was: 1.3.3)

> First-time request doesn't respect XML page and Form encoding
> -------------------------------------------------------------
>
>                 Key: WICKET-1235
>                 URL: https://issues.apache.org/jira/browse/WICKET-1235
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.3.0-rc2
>         Environment: Windows 2000, jdk1.4.2_14-b05, Apache Tomcat 4.1.36-LE, Wicket 1.3.0-rc2
>            Reporter: Evgeniy Karyakin
>            Assignee: Juergen Donnerstag
>         Attachments: Wicket13Test.jar, Wicket13Test.war
>
>
> One test page with <?xml version="1.0" encoding="UTF-8"?> XML declaration in it (Wicket13TestHomePage.html):
> <?xml version="1.0" encoding="UTF-8"?>
> <!DOCTYPE html
>     PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
>     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
> <html xmlns:wicket="http://wicket.sourceforge.net/">
> <head>
> <title>Wicket13Test</title>
> </head>
> <body>
> <!-- Form in question -->
> <form wicket:id="testform" accept-charset="UTF-8">
> <input type="text" wicket:id="inputtest"/>
> <input type="submit"/>
> </form>
> <!-- /Form -->
> </body>
> </html>
> WebApplication implementation set application-wide response-request encoding to UTF-8:
> package com.example.wicket13test;
> import org.apache.wicket.protocol.http.WebApplication;
> public class Wicket13TestApplication extends WebApplication {
> 	public Wicket13TestApplication() {
> 	}
> 	public Class getHomePage() {
> 		return Wicket13TestHomePage.class;
> 	}
> 	public void init() {
> 		super.init();
> 		getRequestCycleSettings().setResponseRequestEncoding("UTF-8");
> 	}
> }
> FIRST browser request of http://localhost/Wicket13Test/ gives this response headers:
> HTTP/1.x 200 OK
> Server: Apache-Coyote/1.1
> Pragma: no-cache
> Cache-Control: no-cache, max-age=0, must-revalidate
> Content-Type: text/html;charset=ISO-8859-5
> Content-Language: ru-RU
> Content-Length: 638
> Date: Tue, 18 Dec 2007 09:31:04 GMT
> That is, Content-Type is ISO-8859-5 (JVM's default?), but I assume it should already be UTF-8. Second and consequent requests result in proper response encoding: "Content-Type: text/html;charset=UTF-8". Hands-on web experience says that browser makes form submission using character encoding based on last response's setting. So this situation leads to wrong *first-time* form submission, but second ones are fine. In Firefox 2 form's accept-charset attributes helps forcibly set desired encoding, but in MSIE it doesn't.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (WICKET-1235) First-time request doesn't respect XML page and Form encoding

Posted by "Sergey Derugo (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-1235?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12561289#action_12561289 ] 

Sergey Derugo commented on WICKET-1235:
---------------------------------------

Thy this approach http://anydoby.com/jblog/article.htm?id=37

> First-time request doesn't respect XML page and Form encoding
> -------------------------------------------------------------
>
>                 Key: WICKET-1235
>                 URL: https://issues.apache.org/jira/browse/WICKET-1235
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.3.0-rc2
>         Environment: Windows 2000, jdk1.4.2_14-b05, Apache Tomcat 4.1.36-LE, Wicket 1.3.0-rc2
>            Reporter: Evgeniy Karyakin
>         Attachments: Wicket13Test.jar, Wicket13Test.war
>
>
> One test page with <?xml version="1.0" encoding="UTF-8"?> XML declaration in it (Wicket13TestHomePage.html):
> <?xml version="1.0" encoding="UTF-8"?>
> <!DOCTYPE html
>     PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
>     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
> <html xmlns:wicket="http://wicket.sourceforge.net/">
> <head>
> <title>Wicket13Test</title>
> </head>
> <body>
> <!-- Form in question -->
> <form wicket:id="testform" accept-charset="UTF-8">
> <input type="text" wicket:id="inputtest"/>
> <input type="submit"/>
> </form>
> <!-- /Form -->
> </body>
> </html>
> WebApplication implementation set application-wide response-request encoding to UTF-8:
> package com.example.wicket13test;
> import org.apache.wicket.protocol.http.WebApplication;
> public class Wicket13TestApplication extends WebApplication {
> 	public Wicket13TestApplication() {
> 	}
> 	public Class getHomePage() {
> 		return Wicket13TestHomePage.class;
> 	}
> 	public void init() {
> 		super.init();
> 		getRequestCycleSettings().setResponseRequestEncoding("UTF-8");
> 	}
> }
> FIRST browser request of http://localhost/Wicket13Test/ gives this response headers:
> HTTP/1.x 200 OK
> Server: Apache-Coyote/1.1
> Pragma: no-cache
> Cache-Control: no-cache, max-age=0, must-revalidate
> Content-Type: text/html;charset=ISO-8859-5
> Content-Language: ru-RU
> Content-Length: 638
> Date: Tue, 18 Dec 2007 09:31:04 GMT
> That is, Content-Type is ISO-8859-5 (JVM's default?), but I assume it should already be UTF-8. Second and consequent requests result in proper response encoding: "Content-Type: text/html;charset=UTF-8". Hands-on web experience says that browser makes form submission using character encoding based on last response's setting. So this situation leads to wrong *first-time* form submission, but second ones are fine. In Firefox 2 form's accept-charset attributes helps forcibly set desired encoding, but in MSIE it doesn't.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (WICKET-1235) First-time request doesn't respect XML page and Form encoding

Posted by "Evgeniy Karyakin (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WICKET-1235?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Evgeniy Karyakin updated WICKET-1235:
-------------------------------------

    Attachment: Wicket13Test.jar

JAR file with page's implementation and XML file. Placed into shared/lib .

> First-time request doesn't respect XML page and Form encoding
> -------------------------------------------------------------
>
>                 Key: WICKET-1235
>                 URL: https://issues.apache.org/jira/browse/WICKET-1235
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.3.0-rc2
>         Environment: Windows 2000, jdk1.4.2_14-b05, Apache Tomcat 4.1.36-LE, Wicket 1.3.0-rc2
>            Reporter: Evgeniy Karyakin
>         Attachments: Wicket13Test.jar, Wicket13Test.war
>
>
> One test page with <?xml version="1.0" encoding="UTF-8"?> XML declaration in it (Wicket13TestHomePage.html):
> <?xml version="1.0" encoding="UTF-8"?>
> <!DOCTYPE html
>     PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
>     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
> <html xmlns:wicket="http://wicket.sourceforge.net/">
> <head>
> <title>Wicket13Test</title>
> </head>
> <body>
> <!-- Form in question -->
> <form wicket:id="testform" accept-charset="UTF-8">
> <input type="text" wicket:id="inputtest"/>
> <input type="submit"/>
> </form>
> <!-- /Form -->
> </body>
> </html>
> WebApplication implementation set application-wide response-request encoding to UTF-8:
> package com.example.wicket13test;
> import org.apache.wicket.protocol.http.WebApplication;
> public class Wicket13TestApplication extends WebApplication {
> 	public Wicket13TestApplication() {
> 	}
> 	public Class getHomePage() {
> 		return Wicket13TestHomePage.class;
> 	}
> 	public void init() {
> 		super.init();
> 		getRequestCycleSettings().setResponseRequestEncoding("UTF-8");
> 	}
> }
> FIRST browser request of http://localhost/Wicket13Test/ gives this response headers:
> HTTP/1.x 200 OK
> Server: Apache-Coyote/1.1
> Pragma: no-cache
> Cache-Control: no-cache, max-age=0, must-revalidate
> Content-Type: text/html;charset=ISO-8859-5
> Content-Language: ru-RU
> Content-Length: 638
> Date: Tue, 18 Dec 2007 09:31:04 GMT
> That is, Content-Type is ISO-8859-5 (JVM's default?), but I assume it should already be UTF-8. Second and consequent requests result in proper response encoding: "Content-Type: text/html;charset=UTF-8". Hands-on web experience says that browser makes form submission using character encoding based on last response's setting. So this situation leads to wrong *first-time* form submission, but second ones are fine. In Firefox 2 form's accept-charset attributes helps forcibly set desired encoding, but in MSIE it doesn't.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (WICKET-1235) First-time request doesn't respect XML page and Form encoding

Posted by "Evgeniy Karyakin (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-1235?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12552892 ] 

Evgeniy Karyakin commented on WICKET-1235:
------------------------------------------

Two conditions must be uphold to reproduce it:
1) Microsoft Internet Explorer
2) *The very first page* (after freshly entering an application) must contain a form to submit. If you browse one simple page, then second, then third one with a form and submit it, everything will be fine -- both response and request encodings are already set to UTF-8 (manually or by default, whatever).
BTW, to break FF good behaviour as well, remove "accept-encoding" attribute from FORM element, and a browser will send a form using encoding that was set during last response -- in my case it's ISO-8859-5 instead of UTF-8 that I expected to see *the very first time* I access application's first page.
Anyway, please try exactly my WAR/JAR files, then access application's root (home page will be displayed), enter some non-ASCII text into text field and submit it -- you should see gambled characters in text field. And watch HTTP headers flying back and forth.
Simple problem display (at least for me) is that 1) HTML (XML) file has XML declaration stating it's UTF-8; 2) UTF-8 is set by default, as you say; but *first-time* Content-Type HTTP headers tells me it's ISO-8859-5.
If I'm wrong in my assumptions or doing anything not as I should, please let me know.

> First-time request doesn't respect XML page and Form encoding
> -------------------------------------------------------------
>
>                 Key: WICKET-1235
>                 URL: https://issues.apache.org/jira/browse/WICKET-1235
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.3.0-rc2
>         Environment: Windows 2000, jdk1.4.2_14-b05, Apache Tomcat 4.1.36-LE, Wicket 1.3.0-rc2
>            Reporter: Evgeniy Karyakin
>         Attachments: Wicket13Test.jar, Wicket13Test.war
>
>
> One test page with <?xml version="1.0" encoding="UTF-8"?> XML declaration in it (Wicket13TestHomePage.html):
> <?xml version="1.0" encoding="UTF-8"?>
> <!DOCTYPE html
>     PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
>     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
> <html xmlns:wicket="http://wicket.sourceforge.net/">
> <head>
> <title>Wicket13Test</title>
> </head>
> <body>
> <!-- Form in question -->
> <form wicket:id="testform" accept-charset="UTF-8">
> <input type="text" wicket:id="inputtest"/>
> <input type="submit"/>
> </form>
> <!-- /Form -->
> </body>
> </html>
> WebApplication implementation set application-wide response-request encoding to UTF-8:
> package com.example.wicket13test;
> import org.apache.wicket.protocol.http.WebApplication;
> public class Wicket13TestApplication extends WebApplication {
> 	public Wicket13TestApplication() {
> 	}
> 	public Class getHomePage() {
> 		return Wicket13TestHomePage.class;
> 	}
> 	public void init() {
> 		super.init();
> 		getRequestCycleSettings().setResponseRequestEncoding("UTF-8");
> 	}
> }
> FIRST browser request of http://localhost/Wicket13Test/ gives this response headers:
> HTTP/1.x 200 OK
> Server: Apache-Coyote/1.1
> Pragma: no-cache
> Cache-Control: no-cache, max-age=0, must-revalidate
> Content-Type: text/html;charset=ISO-8859-5
> Content-Language: ru-RU
> Content-Length: 638
> Date: Tue, 18 Dec 2007 09:31:04 GMT
> That is, Content-Type is ISO-8859-5 (JVM's default?), but I assume it should already be UTF-8. Second and consequent requests result in proper response encoding: "Content-Type: text/html;charset=UTF-8". Hands-on web experience says that browser makes form submission using character encoding based on last response's setting. So this situation leads to wrong *first-time* form submission, but second ones are fine. In Firefox 2 form's accept-charset attributes helps forcibly set desired encoding, but in MSIE it doesn't.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (WICKET-1235) First-time request doesn't respect XML page and Form encoding

Posted by "Juergen Donnerstag (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WICKET-1235?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Juergen Donnerstag resolved WICKET-1235.
----------------------------------------

    Resolution: Invalid

A tomcat 4 problem. Not a wicket problem.

> First-time request doesn't respect XML page and Form encoding
> -------------------------------------------------------------
>
>                 Key: WICKET-1235
>                 URL: https://issues.apache.org/jira/browse/WICKET-1235
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.3.0-rc2
>         Environment: Windows 2000, jdk1.4.2_14-b05, Apache Tomcat 4.1.36-LE, Wicket 1.3.0-rc2
>            Reporter: Evgeniy Karyakin
>            Assignee: Juergen Donnerstag
>             Fix For: 1.3.3
>
>         Attachments: Wicket13Test.jar, Wicket13Test.war
>
>
> One test page with <?xml version="1.0" encoding="UTF-8"?> XML declaration in it (Wicket13TestHomePage.html):
> <?xml version="1.0" encoding="UTF-8"?>
> <!DOCTYPE html
>     PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
>     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
> <html xmlns:wicket="http://wicket.sourceforge.net/">
> <head>
> <title>Wicket13Test</title>
> </head>
> <body>
> <!-- Form in question -->
> <form wicket:id="testform" accept-charset="UTF-8">
> <input type="text" wicket:id="inputtest"/>
> <input type="submit"/>
> </form>
> <!-- /Form -->
> </body>
> </html>
> WebApplication implementation set application-wide response-request encoding to UTF-8:
> package com.example.wicket13test;
> import org.apache.wicket.protocol.http.WebApplication;
> public class Wicket13TestApplication extends WebApplication {
> 	public Wicket13TestApplication() {
> 	}
> 	public Class getHomePage() {
> 		return Wicket13TestHomePage.class;
> 	}
> 	public void init() {
> 		super.init();
> 		getRequestCycleSettings().setResponseRequestEncoding("UTF-8");
> 	}
> }
> FIRST browser request of http://localhost/Wicket13Test/ gives this response headers:
> HTTP/1.x 200 OK
> Server: Apache-Coyote/1.1
> Pragma: no-cache
> Cache-Control: no-cache, max-age=0, must-revalidate
> Content-Type: text/html;charset=ISO-8859-5
> Content-Language: ru-RU
> Content-Length: 638
> Date: Tue, 18 Dec 2007 09:31:04 GMT
> That is, Content-Type is ISO-8859-5 (JVM's default?), but I assume it should already be UTF-8. Second and consequent requests result in proper response encoding: "Content-Type: text/html;charset=UTF-8". Hands-on web experience says that browser makes form submission using character encoding based on last response's setting. So this situation leads to wrong *first-time* form submission, but second ones are fine. In Firefox 2 form's accept-charset attributes helps forcibly set desired encoding, but in MSIE it doesn't.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (WICKET-1235) First-time request doesn't respect XML page and Form encoding

Posted by "Johan Compagner (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-1235?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12576773#action_12576773 ] 

Johan Compagner commented on WICKET-1235:
-----------------------------------------

are you saying that the exact same wicket code works under tomcat 5 but doesn't under tomcat 4?
If thats the case then still try to blame wicket? Then it looks to me like a tomcat problem that got fixed.

wicket tries to set the encoding everytime, see WicketFilter:

// If the request does not provide information about the encoding of
			// its body (which includes POST parameters), than assume the
			// default encoding as defined by the wicket application. Bear in
			// mind that the encoding of the request usually is equal to the
			// previous response.
			// However it is a known bug of IE that it does not provide this
			// information. Please see the wiki for more details and why all
			// other browser deliberately copied that bug.
			if (servletRequest.getCharacterEncoding() == null)
			{
				try
				{
					// The encoding defined by the wicket settings is used to
					// encode the responses. Thus, it is reasonable to assume
					// the request has the same encoding. This is especially
					// important for forms and form parameters.
					servletRequest.setCharacterEncoding(webApplication.getRequestCycleSettings()
						.getResponseRequestEncoding());
				}
				catch (UnsupportedEncodingException ex)
				{
					throw new WicketRuntimeException(ex.getMessage());
				}
			}

> First-time request doesn't respect XML page and Form encoding
> -------------------------------------------------------------
>
>                 Key: WICKET-1235
>                 URL: https://issues.apache.org/jira/browse/WICKET-1235
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.3.0-rc2
>         Environment: Windows 2000, jdk1.4.2_14-b05, Apache Tomcat 4.1.36-LE, Wicket 1.3.0-rc2
>            Reporter: Evgeniy Karyakin
>         Attachments: Wicket13Test.jar, Wicket13Test.war
>
>
> One test page with <?xml version="1.0" encoding="UTF-8"?> XML declaration in it (Wicket13TestHomePage.html):
> <?xml version="1.0" encoding="UTF-8"?>
> <!DOCTYPE html
>     PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
>     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
> <html xmlns:wicket="http://wicket.sourceforge.net/">
> <head>
> <title>Wicket13Test</title>
> </head>
> <body>
> <!-- Form in question -->
> <form wicket:id="testform" accept-charset="UTF-8">
> <input type="text" wicket:id="inputtest"/>
> <input type="submit"/>
> </form>
> <!-- /Form -->
> </body>
> </html>
> WebApplication implementation set application-wide response-request encoding to UTF-8:
> package com.example.wicket13test;
> import org.apache.wicket.protocol.http.WebApplication;
> public class Wicket13TestApplication extends WebApplication {
> 	public Wicket13TestApplication() {
> 	}
> 	public Class getHomePage() {
> 		return Wicket13TestHomePage.class;
> 	}
> 	public void init() {
> 		super.init();
> 		getRequestCycleSettings().setResponseRequestEncoding("UTF-8");
> 	}
> }
> FIRST browser request of http://localhost/Wicket13Test/ gives this response headers:
> HTTP/1.x 200 OK
> Server: Apache-Coyote/1.1
> Pragma: no-cache
> Cache-Control: no-cache, max-age=0, must-revalidate
> Content-Type: text/html;charset=ISO-8859-5
> Content-Language: ru-RU
> Content-Length: 638
> Date: Tue, 18 Dec 2007 09:31:04 GMT
> That is, Content-Type is ISO-8859-5 (JVM's default?), but I assume it should already be UTF-8. Second and consequent requests result in proper response encoding: "Content-Type: text/html;charset=UTF-8". Hands-on web experience says that browser makes form submission using character encoding based on last response's setting. So this situation leads to wrong *first-time* form submission, but second ones are fine. In Firefox 2 form's accept-charset attributes helps forcibly set desired encoding, but in MSIE it doesn't.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (WICKET-1235) First-time request doesn't respect XML page and Form encoding

Posted by "Evgeniy Karyakin (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-1235?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12562393#action_12562393 ] 

Evgeniy Karyakin commented on WICKET-1235:
------------------------------------------

@Sergey Derugo
Yes, this approach might work (saw this before), but what about programmatic encoding setting, why is it for then? Until now I've found two ways to claim needed encoding:
* org.apache.wicket.settings.IRequestCycleSettings#setResponseRequestEncoding(String)
* org.apache.wicket.settings.IMarkupSettings#setDefaultMarkupEncoding(String)
XML encoding was in game prior to version 1.1 AFAIK.
Juergen said that first one's value is UTF-8 by default, OK, no harm to set it explicitly, and I also used second method. And reconfigured Tomcat4's Connector as your link said -- to no avail. Still first-time response claims that its encoding is ISO-8859-5, ruining form's submitted data. Subsequent request-response cycles switch to using UTF-8 and everything is well.
Tomcat is 4.1.36-LE, Java 4, Win2K (English language) with Russian regional settings.

> First-time request doesn't respect XML page and Form encoding
> -------------------------------------------------------------
>
>                 Key: WICKET-1235
>                 URL: https://issues.apache.org/jira/browse/WICKET-1235
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.3.0-rc2
>         Environment: Windows 2000, jdk1.4.2_14-b05, Apache Tomcat 4.1.36-LE, Wicket 1.3.0-rc2
>            Reporter: Evgeniy Karyakin
>         Attachments: Wicket13Test.jar, Wicket13Test.war
>
>
> One test page with <?xml version="1.0" encoding="UTF-8"?> XML declaration in it (Wicket13TestHomePage.html):
> <?xml version="1.0" encoding="UTF-8"?>
> <!DOCTYPE html
>     PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
>     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
> <html xmlns:wicket="http://wicket.sourceforge.net/">
> <head>
> <title>Wicket13Test</title>
> </head>
> <body>
> <!-- Form in question -->
> <form wicket:id="testform" accept-charset="UTF-8">
> <input type="text" wicket:id="inputtest"/>
> <input type="submit"/>
> </form>
> <!-- /Form -->
> </body>
> </html>
> WebApplication implementation set application-wide response-request encoding to UTF-8:
> package com.example.wicket13test;
> import org.apache.wicket.protocol.http.WebApplication;
> public class Wicket13TestApplication extends WebApplication {
> 	public Wicket13TestApplication() {
> 	}
> 	public Class getHomePage() {
> 		return Wicket13TestHomePage.class;
> 	}
> 	public void init() {
> 		super.init();
> 		getRequestCycleSettings().setResponseRequestEncoding("UTF-8");
> 	}
> }
> FIRST browser request of http://localhost/Wicket13Test/ gives this response headers:
> HTTP/1.x 200 OK
> Server: Apache-Coyote/1.1
> Pragma: no-cache
> Cache-Control: no-cache, max-age=0, must-revalidate
> Content-Type: text/html;charset=ISO-8859-5
> Content-Language: ru-RU
> Content-Length: 638
> Date: Tue, 18 Dec 2007 09:31:04 GMT
> That is, Content-Type is ISO-8859-5 (JVM's default?), but I assume it should already be UTF-8. Second and consequent requests result in proper response encoding: "Content-Type: text/html;charset=UTF-8". Hands-on web experience says that browser makes form submission using character encoding based on last response's setting. So this situation leads to wrong *first-time* form submission, but second ones are fine. In Firefox 2 form's accept-charset attributes helps forcibly set desired encoding, but in MSIE it doesn't.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.