PDA

View Full Version : Problem with file upload response: '&' not getting replaced



ngd
11 Mar 2012, 7:07 PM
REQUIRED INFORMATION


Ext version tested:
Ext 4.0.7

Browser versions tested against:
Chrome

DOCTYPE tested against:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

Description:
Ext.form.Basic API docs says: Characters which are significant to an HTML parser must be sent as HTML entities, so encode "<" as "&lt;", "&" as "&amp;" etc.

However when my file upload servlet returns with content type = text/html the following:


{&quot;nextUrl&quot;:&quot;import.wm?sk=1234&amp;step=2&quot;,&quot;nextArgs&quot;:null,&quot;success&quot;:true}

In my handler code is javascript, I get a javascript object as expected with a property "nextUrl". However the value of "nextUrl" still has the "&amp;" in it. I am expecting it to be : import.wm?sk=1234&step=2 but I get: import.wm?sk=1234&amp;step=2

HELPFUL INFORMATION


Debugging already done:
none

Possible fix:
If I do not html encode the response everything seems to work fine (at least in Chrome and IE9)

mitchellsimoens
12 Mar 2012, 10:59 AM
Is your JSON exactly like this?


{&quot;nextUrl&quot;:&quot;import.wm?sk=1234&amp;step=2&quot;,&quot;nextArgs&quot;:null,&quot;success&quot;:true}