i am using Spring 3.x for my MVC application without annotation. I want to get data only not view . I google it and found it is possible using @ResponseBody . but i dont want to use annotation. how can i tell spring it is only data not a view without annotation. my sample code given below .
public class ShowGraphController extends AbstractController {
private JdbcUserDao userDao;
public void setUserDao(JdbcUserDao userDao) {
this.userDao = userDao;
}
protected ModelAndView handleRequestInternal(HttpServletRequest request,HttpServletResponse responce) throws Exception {{
return new ModelAndView("want it retun as a data not a view name only");
}
}
I assume you mean JSON when you say data?
If you have to use ModelAndView style just handle the HttpServletResponse yourself and return null.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With