ASF Bugzilla – Attachment 37094 Details for
Bug 64218
Servlet receives no parameters from post request
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
html file for test app to reproduce
index.html (text/html), 2.62 KB, created by
ron
on 2020-03-11 17:10:41 UTC
(
hide
)
Description:
html file for test app to reproduce
Filename:
MIME Type:
Creator:
ron
Created:
2020-03-11 17:10:41 UTC
Size:
2.62 KB
patch
obsolete
><html> ><head> > <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script> > <script> > function generatePayload(length) > { > var result = ''; > var characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'; > var charactersLength = characters.length; > for ( var i = 0; i < length; i++ ) > result += characters.charAt(Math.floor(Math.random() * charactersLength)); > return result; > } > > function submitTest() > { > var length = parseInt($('#inputLength').val()); > var data = { > payload: generatePayload(length) > }; > > var ajaxargs = > { > type: "POST", > url: "Test", > data: data, > dataType: 'json', > success: function(responseData){ > if (responseData.size == length) > addLogEntry(true, length + ' bytes sent successfully'); > else > { > invalid++ > addLogEntry(false, length + ' bytes sent, ' + responseData.size + ' bytes received') > } > }, > error: function(){ > errors++; > addLogEntry(false, 'ERROR') > } > }; > > $.ajax(ajaxargs); > sent++; > bytes += length; > refreshStats(); > } > > > function addLogEntry(success, text) > { > $("<div/>") > .text(text) > .toggleClass('error', !success) > .prependTo('#divLog'); > > refreshStats(); > > if ($("#continuous:checked").length > 0) > setTimeout(submitTest, parseInt($("#msDelay").val())); > } > > function refreshStats() > { > $("#spanSent").text(sent); > $("#spanBytes").text(bytes); > $("#spanInvalid").text(invalid); > $("#spanErrors").text(errors); > } > > var sent = 0; > var bytes = 0; > var invalid = 0; > var errors = 0; > > > $(document).ready(function(){ > $(btnSend).click(submitTest) > }); > </script> > <style> > #divLog{ > border: 1px solid black; > padding: 2px; > } > #divLog > div{ > border: 1px solid blue; > background: #ddddff; > border-radius: 4px; > margin: 2px; > } > #divLog > div.error{ > background: #ffdddd; > } > </style> ></head> ><body> > <input type='text' id='inputLength' value='65000'> bytes <input type='button' value='Send' id='btnSend'><br> > <input type='checkbox' id='continuous'>Send continuously every <input type='text' id='msDelay' value='1000'> ms (uncheck box to stop sending) > <div id='divStats'> > <div><span id=spanSent></span> requests sent</div> > <div><span id=spanBytes></span> bytes sent</div> > <div><span id=spanInvalid></span> invalid</div> > <div><span id=spanErrors></span> errors</div> > </div> > Log (last 1000 requests): > <div id='divLog'></div> ></body> ></html>
<html> <head> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script> <script> function generatePayload(length) { var result = ''; var characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'; var charactersLength = characters.length; for ( var i = 0; i < length; i++ ) result += characters.charAt(Math.floor(Math.random() * charactersLength)); return result; } function submitTest() { var length = parseInt($('#inputLength').val()); var data = { payload: generatePayload(length) }; var ajaxargs = { type: "POST", url: "Test", data: data, dataType: 'json', success: function(responseData){ if (responseData.size == length) addLogEntry(true, length + ' bytes sent successfully'); else { invalid++ addLogEntry(false, length + ' bytes sent, ' + responseData.size + ' bytes received') } }, error: function(){ errors++; addLogEntry(false, 'ERROR') } }; $.ajax(ajaxargs); sent++; bytes += length; refreshStats(); } function addLogEntry(success, text) { $("<div/>") .text(text) .toggleClass('error', !success) .prependTo('#divLog'); refreshStats(); if ($("#continuous:checked").length > 0) setTimeout(submitTest, parseInt($("#msDelay").val())); } function refreshStats() { $("#spanSent").text(sent); $("#spanBytes").text(bytes); $("#spanInvalid").text(invalid); $("#spanErrors").text(errors); } var sent = 0; var bytes = 0; var invalid = 0; var errors = 0; $(document).ready(function(){ $(btnSend).click(submitTest) }); </script> <style> #divLog{ border: 1px solid black; padding: 2px; } #divLog > div{ border: 1px solid blue; background: #ddddff; border-radius: 4px; margin: 2px; } #divLog > div.error{ background: #ffdddd; } </style> </head> <body> <input type='text' id='inputLength' value='65000'> bytes <input type='button' value='Send' id='btnSend'><br> <input type='checkbox' id='continuous'>Send continuously every <input type='text' id='msDelay' value='1000'> ms (uncheck box to stop sending) <div id='divStats'> <div><span id=spanSent></span> requests sent</div> <div><span id=spanBytes></span> bytes sent</div> <div><span id=spanInvalid></span> invalid</div> <div><span id=spanErrors></span> errors</div> </div> Log (last 1000 requests): <div id='divLog'></div> </body> </html>
View Attachment As Raw
Actions:
View
Attachments on
bug 64218
: 37094 |
37095