[ 
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.

Reply via email to