jose
jose

Reputation: 144

Struts2 with Json

Am a newbie in struts2.How can I Use Json in Sruts2 ?. can any one please provide an example or helpful tutorials to learn.

Thanks .

Upvotes: 1

Views: 1349

Answers (1)

Umesh Awasthi
Umesh Awasthi

Reputation: 23587

Well JSON can be use both way

  1. Sending data from your action class to UI
  2. Sending data back to the Action from UI

There are many ways to do this and lots of library out there few of them are

  1. Google Gson
  2. Jackson

Struts2 comes with its own JSON plugin which is light weight fast and well integrated with Struts2, it is capable enough to send and receive data in both way.

I suggest you to have a look at plugin documentation to see how it can be configured as well can be used with Struts2.

Documentation also includes few example to give you an idea and a start-up.

Upvotes: 3

Related Questions