1

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 .

1 Answer 1

3

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.

2
  • And I have one more doubt. Isn't Dojo tollkit a right choice for Struts2?
    – jose
    Oct 9, 2012 at 4:52
  • @jose:DOJO is an excellent framework way better organized and much focused,its a good choice but do not use struts2 dojo tags rather use standalone DOJO and u are good to go at any length Oct 9, 2012 at 4:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.