1
Я хочу вернуть значения в формате json. Я использую (MediaType.APPLICATION_JSON
) для возврата значений. Как вернуть ArrayList
с помощью этого? Пример:Как вернуть arraylist, используя restful webservices в java?
[
{
"node_title": "Ambivalence About Government Will Be Topic at next Lecture ",
"nid": "Topic - Get the Government Off of Our Backs – There Ought to Be a Law: Reconciling Our National Ambivalence About Government."
},
{
"node_title": "Recycling initiative gains steam under new director",
"nid": "University administrators listened and hired a sustainability coordinator whose main focus has been to heighten recycling efforts and awareness."
},
{
"node_title": "Special Week to Combat Hate and Discrimination",
"nid": "For the seventh year, University students will observe “Why Do You Hate Me?” Week, which will run from March 28th through April 2nd."
},
{
"node_title": "AUSP joins Nursing School on mission trip to Caribbean",
"nid": "The School of Audiology and Speech-Language Pathology during spring break went to Dominican Republic to provide much-needed assistance to a school for deaf and impoverished children."
}
]
Прослушайте меня.
Является ли это JSON-то вы получаете откуда-то (как веб-службы), и вы хотите, чтобы разобрать в аррайалист? –
Посмотрите http://www.jsonschema2pojo.org/ – user370305