weird combination! (followup: Form field ignored?!? Weird...)
weird combination! (followup: Form field ignored?!? Weird...)
- Subject: weird combination! (followup: Form field ignored?!? Weird...)
- From: Ondřej Čada <email@hidden>
- Date: Thu, 25 Sep 2008 17:24:52 +0200
Looks like I did find the culprit... kind of, but don't understand it
at all, to be frank :(
It seems that if the two following conditions are combined,
"multipart/form-data" forms send nulls only:
(a) storing session IDs into cookies, by
public class Session extends WOSession {
public Session() {
super();
setStoresIDsInCookies(true);
setStoresIDsInURLs(false);
}
}
(b) using UTF-8 as the page encoding, by
public class Application extends WOApplication {
...
// ensure UTF-8 is actually used anywhere
static public void updateResponseForUTF8(WOResponse rr) {
rr.setContentEncoding(_NSUtilities.UTF8StringEncoding);
rr.setHeader("text/html; charset=UTF-8; encoding=UTF-8",
"content-type");
}
public void appendToResponse(WOResponse rr, WOContext cc) {
updateResponseForUTF8(rr);
super.appendToResponse(rr,cc);
}
public void takeValuesFromRequest(WORequest rr, WOContext cc)
{ //!!!
rr.setDefaultFormValueEncoding
(_NSUtilities.UTF8StringEncoding);
super.takeValuesFromRequest(rr,cc);
}
}
Actually the //!!! method is sufficient to render a multipart/form-
data" form not to work properly -- along with the IDs in cookies; the
appendToResponse method does not need to be overridden for the
problem to occur.
I would be grateful for an insight whether this is my bug or a WO bug
(should I perhaps ensure UTF-8 compliance otherwise?), and I would be
_very_ grateful for any advice how to solve the problem, given the
client insists on both session IDs in cookies and UTF8 pages...
If anyone cares to check, I am attaching the simple test project --
hope it will make it through the list software:
Attachment:
WTF.zip
Description: Zip archive
Thanks,
OC
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden