form提交时候注意过长参数

有时候在form提交的时候经常系统如下形式:

url?p1=p

p1=p数据很长

例如

POST /dvtboss/print/operatelogprintlist/operatelog-printlist!doPrint.action?event_id=20161227007740365335;20161227007740365434;20161227007740365433;20161227007740365432;20161227007740365431;20161227007740365430;20161227007740365429;20161227007740365428;20161227007740365427;20161227007740365426;20161227007740365425;20161227007740365424;20161227007740365423;20161227007740365422;20161227007740365421;20161227007740365420;20161227007740365419;20161227007740365418;20161227007740365417;20161227007740365416;20161227007740365415;20161227007740365414;20161227007740365413;20161227007740365412;20161227007740365411;20161227007740365410;20161227007740365409;20161227007740365408;20161227007740365407;20161227007740365406;20161227007740365405;20161227007740365404;20161227007740365403;20161227007740365402;20161227007740365401;20161227007740365400;20161227007740365399;20161227007740365398;20161227007740365397;20161227007740365396;20161227007740365395;20161227007740365394;20161227007740365393;20161227007740365392;20161227007740365391;20161227007740365390;20161227007740365389;20161227007740365388;20161227007740365387;20161227007740365386;20161227007740365385;20161227007740365384;20161227007740365383;20161227007740365382;20161227007740365381;20161227007740365380;20161227007740365379;20161227007740365378;20161227007740365377;20161227007740365376;20161227007740365375;20161227007740365374;20161227007740365373;20161227007740365372;20161227007740365371;20161227007740365370;20161227007740365369;20161227007740365368;20161227007740365367;20161227007740365366;20161227007740365365;20161227007740365364;20161227007740365363;20161227007740365362;20161227007740365361;20161227007740365360;20161227007740365359;20161227007740365358;20161227007740365357;20161227007740365356;20161227007740365355;20161227007740365354;20161227007740365353;20161227007740365352;20161227007740365351;20161227007740365350;20161227007740365349;20161227007740365348;20161227007740365347;20161227007740365346;20161227007740365345;20161227007740365344;20161227007740365343;20161227007740365342;20161227007740365341;20161227007740365340;20161227007740365339;20161227007740365338;20161227007740365337;20161227007740365336&instpdofferid=undefined HTTP/1.1
Accept: application/x-ms-application, image/jpeg, application/xaml+xml, image/gif, image/pjpeg, application/x-ms-xbap, */*
Referer: http://127.0.0.1:8080/dvtboss/businessmanage/offer/user-offer!toCsOperatingLogPrintList.action?custNo=
Accept-Language: zh-CN
User-Agent: Mozilla/4.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/7.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; .NET4.0C; .NET4.0E; InfoPath.3)
Accept-Encoding: gzip, deflate
Host: 127.0.0.1:8080
Connection: Keep-Alive
Cookie: JSESSIONID=4ea1nfrs54m3jc5skpbcxdnp; style=001; sdmenu_my_menu=100001000000000000000000
Content-Type: application/x-www-form-urlencoded
Content-Length: 2817
Cache-Control: no-cache

要知道Url等于url?p1=p这种形式是把他当成一个url来处理,每个浏览器的URL都有限长,p1=p参数大于浏览器URL限长时,会出现各种问题。

正常的处理要讲参数放在form的input中,避免参数太长引起浏览器对URL限制错误


<s:form name="form1" id="form1" theme="simple">
	<input type="hidden" name="event_id" id="event_id" value=""/>
	<input type="hidden" name="instpdofferid" id="instpdofferid" value=""/>	
</s:form>

 

PS知识点:

<iframe name="printframe" id="printframe" src="#" style="display: none;" width="100%" height="200"></iframe>
$('form1').action="${ctx}/print/operatelogprintlist/operatelog-printlist!doPrint.action";
$('form1').target="printframe";
$('form1').submit();

form的traget属性在form提交是的原理是:

将form1的form进行一次提交,如form1中的参数input会被提交,返回结果填充iframe

转载于:https://my.oschina.net/u/1380237/blog/813866

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值