reset password
Author Message
Sridhar16
Posts: 10
Posted 14:56 Aug 12, 2015 |

Hello Dr Sun,

I am using jquery ajax to retrieve a job object from the controller to jsp and I am getting a 406 error. Do we need to add any jar files to pom.xml to make ajax work??

Thank You

 

cysun
Posts: 2935
Posted 14:59 Aug 12, 2015 |

No.
 

cysun
Posts: 2935
Posted 15:01 Aug 12, 2015 |
cysun wrote:

No.

Well, actually it depends on how your Ajax call is implemented - in particular, whether it expects a JSON response. Since you are doing Ajax which is not required, I assume you know what you are doing.

Sridhar16
Posts: 10
Posted 15:04 Aug 12, 2015 |

Do we need to pass and retrieve only json objects while using ajax?

cysun
Posts: 2935
Posted 15:12 Aug 12, 2015 |
Sridhar16 wrote:

Do we need to pass and retrieve only json objects while using ajax?

You don't have to, as shown in the simple examples in the Ajax lecture. However, if you want to get a somewhat complex object back in response, you almost always want to use either JSON or XML format for the data. Again, since you are doing extra stuff, I assume you know about these things.