Skip to main content

Bug Tracker

Side navigation

#2175 closed bug (invalid)

Opened January 16, 2008 05:12AM UTC

Closed December 05, 2009 01:57AM UTC

Ajax POST does not work

Reported by: awrigh2 Owned by:
Priority: major Milestone: 1.3
Component: ajax Version: 1.2.2
Keywords: Cc: awrigh2, flesler
Blocked by: Blocking:
Description

I am passing a parameter to

the server using ajax,

and the type: GET works,

but the type: POST

does not work.

Attachments (0)
Change History (7)

Changed January 16, 2008 02:35PM UTC by brandon comment:1

priority: criticalmajor

Could you attach a test case where this isn't working for you?

Changed May 13, 2008 03:24AM UTC by flesler comment:2

resolution: → invalid
status: newclosed

4 months, enough for such a generic ticket.

Changed May 13, 2008 05:27PM UTC by flesler comment:3

milestone: 1.2.31.2.4

Changed November 19, 2008 08:28PM UTC by brostbeef comment:4

resolution: invalid
status: closedreopened

Using jQuery to access a JSP page sending two parameters as a JSON object. Parameters are null when retrieved.

Example: (jQuery code)

$.get("my_page.jsp", {

parmPolVerPlanLocNo: polVerPlanLocNo,

parmPolItemInsNo: polItemInsNo

}, function(json){

my func

});

JSP code to retrieve:

Integer polVerPlanLocNo = new Integer(request.getParameter("parmPolVerPlanLocNo"));

Integer polItemInsNo = new Integer(request.getParameter("parmPolItemInsNo"));

The above gives me a parse int error because variables are NULL

Please note that this did not fail from the very beginning. It started to die later on. Also, it does seem to work depending on the server it is on. We have a few local servers and one server will work fine while the next will fail on the code. Changing to $.get() fixes the problem immediately. I wish I could show you live code, but this is for an internal product.

Changed November 19, 2008 10:49PM UTC by flesler comment:5

cc: → awrigh2, flesler
milestone: 1.2.41.3
need: ReviewTest Case

You say $.get works, and in the example, you use $.get...

The fact is, that both $.post and $.get do work. If you're experimenting a problem, then something special must be happening.

We can't do much with the info you provide.

Let me know if you can add something else, or then tell me and I'll close this.

Changed December 19, 2008 04:21AM UTC by atula comment:6

I've assumed you've used $.ajax as well as the wrapper $.post ?

$.ajax({

type: POST,

url : "my_page.jsp",

dataType : 'json',

data: {parmPolVerPlanLocNo: polVerPlanLocNo,

parmPolItemInsNo: polItemInsNo},

success: function (json) {

}

});

Changed December 05, 2009 01:57AM UTC by john comment:7

resolution: → invalid
status: reopenedclosed