• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Spring MVC + Controller return as JSON Example

 
Greenhorn
Posts: 26
Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Folks,

I want a simple program with spring mvc where i am sending JSON data from controller.

I want this without using maven.

Thank you.
 
Sheriff
Posts: 5555
326
IntelliJ IDE Python Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello, welcome to the Ranch!

The best way to get help is to show what you have done so far and explain what part specifically you're having trouble with. Nobody is going to just give you the full solution.

So, what do you have so far? What's the current problem?
 
Ranch Hand
Posts: 954
4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Quick google gives you ton of example for the same. If you have specific problem then let us know as Tim mentioned.
 
Mahesh Suryawanshi
Greenhorn
Posts: 26
Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you for reply

Currently my controller is returning data using ModelMap,like map.addAttribute("employeeList", employeeManager.getAllEmployees());

& accessing this using spring tag in view, like
<c:if  test="${!empty employeeList}"></c:if>

instead i want to used plain html & spring controller should return json data.

what i need to do to achieve this thing.
 
reply
    Bookmark Topic Watch Topic
  • New Topic