Product:
CF 7 BugHunt
User:
Anonymous
[
Switch Product
]
CFUG:
None
Add and View Bug Comments at the bottom of the Element.
Title:
Asynchronous POST error in ColdFusion
BugID:
1364
Date Opened:
14-May-07
Created By:
Rebecca Younes
Type:
Other/Misc
Element/Element:
NA
Severity:
Generates an Error
Status:
New/Unvalidated
Adobe BugID:
Description of bug:
An asynchronous POST request using the Yahoo User Interface (YUI) library fails in both ColdFusion 6.1 and 7 when the event handler that makes the asynchronous request is attached to a form submit button click event rather than to the form submit event. The problem arises because when the form name-value pairs are serialized by YUI, the value "null" gets appended to the string. This causes an error in the Java runtime for a POST request, but not for a GET. Though admittedly the error originates inside YUI, PHP does not generate an error in this case, so there may be some justification for considering this a ColdFusion bug as well. The ColdFusion error that's generated is: Error while parsing POST data java.lang.IllegalArgumentException at javax.servlet.http.HttpUtils.parseQueryString(HttpUtils.java:149) at javax.servlet.http.HttpUtils.parsePostData(HttpUtils.java:252) at jrun.servlet.JRunRequest.parsePostData(JRunRequest.java:381) at jrun.servlet.JRunRequest.getParameters(JRunRequest.java:361) at jrun.servlet.JRunRequest.getInputStream(JRunRequest.java:239) at javax.servlet.ServletRequestWrapper.getInputStream(ServletRequestWrapper.java:191) at coldfusion.filter.FusionContext.getRequestContent(FusionContext.java:602) at coldfusion.filter.FormScope.fillForm(FormScope.java:198) at coldfusion.filter.FusionContext.SymTab_initForRequest(FusionContext.java:384) at coldfusion.filter.GlobalsFilter.invoke(GlobalsFilter.java:33) at coldfusion.filter.DatasourceFilter.invoke(DatasourceFilter.java:22) at coldfusion.CfmServlet.service(CfmServlet.java:105) at coldfusion.bootstrap.BootstrapServlet.service(BootstrapServlet.java:78) at jrun.servlet.ServletInvoker.invoke(ServletInvoker.java:91) at jrun.servlet.JRunInvokerChain.invokeNext(JRunInvokerChain.java:42) at jrun.servlet.JRunRequestDispatcher.invoke(JRunRequestDispatcher.java:257) at jrun.servlet.ServletEngineService.dispatch(ServletEngineService.java:527) at jrun.servlet.http.WebService.invokeRunnable(WebService.java:172) at jrunx.scheduler.ThreadPool$DownstreamMetrics.invokeRunnable(ThreadPool.java:349) at jrunx.scheduler.ThreadPool$ThreadThrottle.invokeRunnable(ThreadPool.java:457) at jrunx.scheduler.ThreadPool$UpstreamMetrics.invokeRunnable(ThreadPool.java:295) at jrunx.scheduler.WorkerThread.run(WorkerThread.java:66) The code to reproduce the error: <html> <head> <!--- YUI libraries available from http://developer.yahoo.com/yui/ ---> <script type="text/javascript" src="yahoo.js"></script> <script type="text/javascript" src="event.js"></script> <script type="text/javascript" src="connection.js"></script> <script> YAHOO.util.Event.addListener(window, "load", init); function init() { //YAHOO.util.Event.addListener("theForm", "submit", makeRequest); YAHOO.util.Event.addListener("btn", "click", makeRequest); } var handleSuccess = function(o){ div = document.getElementById("xhrResponse"); if(o.responseText !== undefined){ div.innerHTML = "Transaction id: " + o.tId; div.innerHTML += "<br />HTTP status: " + o.status; div.innerHTML += "<br />Status code message: " + o.statusText; div.innerHTML += "<br />HTTP headers: <ul>" + o.getAllResponseHeaders + "</ul>"; div.innerHTML += "Response: " + o.responseText; } } var handleFailure = function(o) { msg = ""; for (p in o) { msg += p + ": " + o[p] + "; "; } alert("Transaction failed. Error: " + msg); } var callback = { success:handleSuccess, failure: handleFailure }; function makeRequest(event) { YAHOO.util.Event.stopEvent(event); YAHOO.util.Connect.setForm("theForm"); YAHOO.util.Connect.asyncRequest("POST", "response.cfm", callback); } </script> </head> <body> <div id="xhrResponse"></div> <form id="theForm" method="post" action="response.cfm" > name: <input type="text" name="username" id="username" /><br /> <input type="submit" name="btn" id="btn" value="Send" /> </form> </body> </html> Contents of response.cfm can be anything.
Comments:
--->
A D D Y O U R C O M M E N T S T O T H I S B U G
Please login to add comments to a bug
C O M M E N T S
Comment display is being revamped. We apologize for the delay.