English 中文(简体)
派遣长体在支队中
原标题:sending long strings in jquery post

I am not able to send long strings (more than 96 char. Tested in FF12 and Chrome 18) in jquery post method. My servlet is -

public class TestServletAsh extends HttpServlet{
    protected void doPost(HttpServletRequest req, HttpServletResponse resp)
    throws ServletException, IOException {
        super.doPost(req, resp);
        String xml=req.getParameter("xml");
    }
}

我的格米斯职位要求是:

<body>
<script>
    function callMe() {
        var str = "dkghjkdf dfg jdfgjd gkdfgdjk gdf gdfg dkjgdfjk gdjgdfjg dfjkgdfjkg dfjkgdfjkg dfjkgdf jkdfgdjhgs";
        $.post(
            "TestServletAsh",
            { xml:str },
            function(data) {
                alert("mission successfull");   //nothing to do with it or data here in this SO question
            }
        );
    }
</script>
<a href="javascript:void(0)" onclick="callMe()">Click to send request</a>
</body>

I am debugging the servlet and I find "xml=null". I am using jboss as a webserver. Can anyone please tell me where is the problem.

当我使用另一种分类方法时。 职务:

$.post(
    "TestServletAsh?xml="+str,
    function(data) {
        alert("mission successfull");   //nothing to do with it or data here in this SO question
    }
);

Then I am able to send around 6000 characters. For more than 6000 characters Firebug says - "405 Aborted". Why ?? Any idea ?

最佳回答

May be your webserver i.e. Jboss could be the issue. You can look into changing server config parameters

Try establishing maxPostSize = 0 in conf/server.xml file

问题回答

暂无回答




相关问题
CSS working only in Firefox

I am trying to create a search text-field like on the Apple website. The HTML looks like this: <div class="frm-search"> <div> <input class="btn" type="image" src="http://www....

image changed but appears the same in browser

I m writing a php script to crop an image. The script overwrites the old image with the new one, but when I reload the page (which is supposed to pickup the new image) I still see the old one. ...

Firefox background image horizontal centering oddity

I am building some basic HTML code for a CMS. One of the page-related options in the CMS is "background image" and "stretch page width / height to background image width / height." so that with large ...

Separator line in ASP.NET

I d like to add a simple separator line in an aspx web form. Does anyone know how? It sounds easy enough, but still I can t manage to find how to do it.. 10x!

热门标签