Can anyone give me an example of how to return the following json simply from a jsp without any external libraries (except the ones that come standard with Oracle Java)?
This is the code:
JSP Page
Hello World!
and this is the JSON:
[
{"label":"item 1", "value":"item 1", "id": 1},
{"label":"item 2", "value":"item 2", "id": 2},
{"label":"item 3", "value":"item 1", "id": 3}
]
<%
// Returns all employees (active and terminated) as json.
response.setContentType("application/json");
%>