weixin_33716941 2015-06-01 07:19 采纳率: 0%
浏览 1424

POST请求参数丢失

Client Code

function Call() 
{
    var value = $('input[name=form]:checked').val();
    if (typeof(value)=='undefined')
    {
        alert('Select One Record');
        return false;
    }
    else
    {
        $("#bean\\.id").val(value.split("@@")[0]);
        var id = $("#bean\\.id").val();
        $.post("search.do", {'id': id},
        function(data){

        });
    }
}
<s:hidden name="bean.id" id="bean.id" />
<s:iterator var="form" value="#request.list" status="offset">
<input type="radio" name="form" value="${form.id}@@${form.status}"></input>
</s:iterator>

Server Code Struts2 config XML

<action name="search" class="<action name>" method="search">
    <result name="success" type="json">
        <param name="includeProperties">returnString</param>
    </result>
</action>

Java Action Function

public String search() throws Exception
{
    String id_server = context.getRequest().getParameter("id");
    // Do some stuff    
    return SUCCESS;
}

Using Websphere 8.5.0.4.

It seems that sometimes the request parameter is not existed.
(id_server=null)
Does anyone have any idea why this happen?
I have other places using very similar code without problem.

I have failed to re-produce the problem. But my testing environment is Websphere 8.5.5.4.
I am not sure if this is the Websphere problem as the problem area is using 8.5.0.4 (Production environment).

Does anyone have any idea with this problem? Mainly I want to know the reason as I may need to explain.
Many Thanks

  • 写回答

1条回答 默认 最新

  • weixin_33736048 2015-06-01 07:54
    关注

    By default servers put restriction on size of post request like in tomcat by default it is 2mb. If post request size exceeds this size, request parameters are discarded by server. You may check https://serverfault.com/questions/311610/how-to-increase-the-size-of-http-post-request-in-websphere to change it for websphere.

    评论

报告相同问题?

悬赏问题

  • ¥15 redis-full-check比较 两个集群的数据出错
  • ¥15 Matlab编程问题
  • ¥15 训练的多模态特征融合模型准确度很低怎么办
  • ¥15 kylin启动报错log4j类冲突
  • ¥15 超声波模块测距控制点灯,灯的闪烁很不稳定,经过调试发现测的距离偏大
  • ¥15 import arcpy出现importing _arcgisscripting 找不到相关程序
  • ¥15 onvif+openssl,vs2022编译openssl64
  • ¥15 iOS 自定义输入法-第三方输入法
  • ¥15 很想要一个很好的答案或提示
  • ¥15 扫描项目中发现AndroidOS.Agent、Android/SmsThief.LI!tr