The tapestry application login page has a property that stores a password that the user enters, which is then compared to a value from the database. If the user enters a password with multibyte characters, for example:
áéíóú
... checking the return value of getPassword () (an abstract method for the corresponding property) gives:
áéÃóú
Clearly this is incorrectly encoded. Nevertheless, Firebug reports that the page is submitted in UTF-8, so, presumably, the request to submit the form will also be encoded in UTF-8. Checking the value coming from the database leads to the correct row, so it will not be a problem encoding the OS or IDE. I did not override the default value for Tapestry for org.apache.tapestry.output-encoding in the .application file, and the Tapestry 4 documentation indicates that the default value for the property is UTF-8.
So why does Tapestry seem like it encodes an encoding when setting a property?
The appropriate code should be:
login.html
<html jwcid="@Shell" doctype='html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"' ...>
<body jwcid="@Body">
...
<form jwcid="@Form" listener="listener:attemptLogin" ...>
...
<input jwcid="password"/>
...
</form>
...
</body>
</html>
Login.page
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE page-specification
PUBLIC "-//Apache Software Foundation//Tapestry Specification 4.0//EN"
"http://jakarta.apache.org/tapestry/dtd/Tapestry_4_0.dtd">
<page-specification class="mycode.Login">
...
<property name="password" />
...
<component id="password" type="TextField">
<binding name="value" value="password"/>
<binding name="hidden" value="true"/>
...
</component>
...
</page-specification>
Login.java
...
public abstract class Login extends BasePage {
...
public abstract String getPassword();
...
public void attemptLogin() {
}
...
}
Update
@Jan Soltis: , , , , , , . .application; org.apache.tapestry.output-encoding, Tapestry 4 , UTF-8. , .
@myself: .