Re: Default form value encoding was changed after parsing multi-part form. Form values will be lost.
Re: Default form value encoding was changed after parsing multi-part form. Form values will be lost.
- Subject: Re: Default form value encoding was changed after parsing multi-part form. Form values will be lost.
- From: Chuck Hill <email@hidden>
- Date: Mon, 21 Sep 2009 12:43:20 -0700
Have you changed WO versions? Do you have this in your Properties file?
er.extensions.ERXApplication.DefaultEncoding=UTF-8
Chuck
On Sep 21, 2009, at 12:34 PM, Mark Wardle wrote:
Hi all,
I have a component that edits a specific EO allowing upload of a user
photo. Using WO 5.4.3 on Snow Leopard,
java.runtime.version=1.6.0_15-b03-219, Project Wonder (revision 9861).
It used to work. Something changed - my code, leopard->snow leopard,
project wonder? I don't know what!
Suddenly the component was editing objects that failed validation and
it was not clear why. I realised that a form submission seemed to be
going wrong (no form values were passed). Eventually I removed the
WOUpload component out of desperation and then started receiving this
exception:
Sep 21 19:31:14 rsdb[52783] WARN NSLog -
<com.webobjects.appserver._private.WOComponentRequestHandler>:
Exception occurred while handling request:
java.lang.IllegalStateException: Default form value encoding was
changed after parsing multi-part form. Form values will be lost.
[2009-9-21 19:31:14 BST] <WorkerThread0>
java.lang.IllegalStateException: Default form value encoding was
changed after parsing multi-part form. Form values will be lost.
Aha! A clue. I can solve the problem by removing the WOUpload
component AND removing the enctype from the WOForm:
<wo:form enctype = "multipart/form-data" multipleSubmit = "true"
action = "$saveChangesAction">
...
</wo:form>
There are many posts on the subject of UTF-8 and UTF8, including on
the wiki and even in the apple documentation. However, there doesn't
seem to be much consensus and it looks like most of the answers
revolve around setting encoding at the end of generating a response
(in Application class) and setting the formencoding (in the
Application and Session classes). These don't work; they don't cause
problems but don't solve the problem. I suspect I'm getting UTF-8
encoding anyway from what I get log from different points in the
RR-loop.
I don't manually set encoding and my application is fully Project
Wonder'd; ERXSession, ERXApplication etc., and by the looks of the
source code, the encoding should be correctly intuited.
Obviously, without the "multipart/form-data" setting, WOUpload
(ERXWOUpload) complains.
Any ideas? I'm sure this was working.
Many thanks,
Mark
--
Dr. Mark Wardle
Specialist registrar, Neurology
Cardiff, UK
_______________________________________________
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
--
Chuck Hill Senior Consultant / VP Development
Practical WebObjects - for developers who want to increase their
overall knowledge of WebObjects or who are trying to solve specific
problems.
http://www.global-village.net/products/practical_webobjects
_______________________________________________
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