Announcement Announcement Module
Collapse
No announcement yet.
jQuery - AJAX and SpringMVC Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • jQuery - AJAX and SpringMVC

    I'm sending block of text containing html to a spring controller via ajax call and I'm url encoding it like so:

    Code:
    $('#someHTMLContent').serialisze();
    However, when I try to display that in a jsp based view, doing
    Code:
    ${ myModelObject.someHTMLContent }
    does not url decode the content of that string.

    So I'm having to do something like this
    Code:
    <%
    com.my.package.myModelObject o = (MyModelObject) request.getAttribute("myModelObject");
    out.println(  URLDecoder.decode( o.getSomeHTMLContent )  );
    %>
    It gets the job done, but I wonder if it can be accomplished a cleaner fashion?
Working...
X