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 为什么使用javacv转封装rtsp为rtmp时出现如下问题:[h264 @ 000000004faf7500]no frame?
  • ¥15 乘性高斯噪声在深度学习网络中的应用
  • ¥15 运筹学排序问题中的在线排序
  • ¥15 关于docker部署flink集成hadoop的yarn,请教个问题 flink启动yarn-session.sh连不上hadoop,这个整了好几天一直不行,求帮忙看一下怎么解决
  • ¥30 求一段fortran代码用IVF编译运行的结果
  • ¥15 深度学习根据CNN网络模型,搭建BP模型并训练MNIST数据集
  • ¥15 C++ 头文件/宏冲突问题解决
  • ¥15 用comsol模拟大气湍流通过底部加热(温度不同)的腔体
  • ¥50 安卓adb backup备份子用户应用数据失败
  • ¥20 有人能用聚类分析帮我分析一下文本内容嘛