• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Ajax post request content problem

 
Ranch Hand
Posts: 112
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have a problem with the ajax post request.

I have a form. Initially when the form page is loaded. Based on the search criteria iam going to
make a ajax post request. In this case the post request 'Content-Type' is correct(application/x-www-form-urlencoded). The post request goes to
the ActionServlet and then iam populating the GRID with the response.

I have a export option in the grid which will export the grid data to a XL sheet through a normal HTTPServlet but not ActionServlet. When i do this
export and try to change the search criteria and submit the request (next search criteria), now this time the request Content-type is changed to 'plain/text'.

I am not sure why after exporting grid data to XL, the next ajax request header information
is changing specially the 'Content-type' so the posted Data is not visible at server. I think it is taking the previous (export) request header information.

So due to this the subsequent ajax post requests are failing as the post data in the request header is not interpreted at the server.

I tried to clear the cache at the server using the below statements, but it doesn't work.

response.setHeader("Cache-Control","no-cache");

Please help me, thanks in advance for your time.

 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Have you used a tool such as Fiddler to see what is being sent up to the server [Data and headers]?

Eric
 
Sheriff
Posts: 67747
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
"Venkat Gm", please check your private messages for an important administrative matter.

Also, do not post in all uppercase. I have adjusted the topic title for you. Please read this for more information.
 
Venkata Sirish
Ranch Hand
Posts: 112
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Eric for reverting, yes i have used fiddler, the thing is request content-type is getting changed to text/plain, not sure why? eventhough iam making as POST ajax request.
 
reply
    Bookmark Topic Watch Topic
  • New Topic