Announcement Announcement Module
Collapse
No announcement yet.
I just want my view to come from a POJO Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • I just want my view to come from a POJO

    Hello,
    This may win the award for the dumbest question yet. But I've just started moving all my view rendering from JSP's to POJO's. I just don't want to bother with JSP anymore. So since I'm gutting everything, I thought this would be a good time to make the leap from Struts to Spring MVC as well. Anyway, I'm just getting started. I went through the doc and a tutorial. So I see how to forward to a JSP by doing something like, "return new ModelAndView("test.jps")" in the controller.... but I'm not using JSP. I'm thinking my answer might be the "Integrating view technologies" section of doc. But I'm just not getting it.

    Any hints on how to do something simple like..
    return MyObject.toHtml()?

    Thanks

  • #2
    Never mind. The reference guide wasn't really clear to me. However, the API documenation for ModelAndView cleared it all up.
    All I needed to do was create a class implementing View, then write directly to the HttpServletResponse, create an instance of it and pass it back as part of the ModelAndView wrapper. Pretty simple.

    Comment


    • #3
      Originally posted by jones
      Hello,
      This may win the award for the dumbest question yet.
      Sorry, I believe I've already won that for this year.

      Comment


      • #4
        Ha ha.. well you've got some serious competition now

        Comment

        Working...
        X