Bug Tracker

Opened 12 years ago

Closed 10 years ago

#2175 closed bug (invalid)

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.

Change History (7)

comment:1 Changed 12 years ago by brandon

Priority: criticalmajor

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

comment:2 Changed 12 years ago by flesler

Resolution: invalid
Status: newclosed

4 months, enough for such a generic ticket.

comment:3 Changed 12 years ago by flesler

Milestone: 1.2.31.2.4

comment:4 Changed 11 years ago by brostbeef

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.

comment:5 Changed 11 years ago by flesler

Cc: awrigh2 flesler added
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.

comment:6 Changed 11 years ago by atula

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) {

}

});

comment:7 Changed 10 years ago by john

Resolution: invalid
Status: reopenedclosed
Note: See TracTickets for help on using tickets.