Ajax tag refresh the list with the whole JSP

evan yang
2009-05-30
2013-01-31
  • evan yang

    evan yang - 2009-05-30

    I have problem in using the ajax:displayTag. The list area that wrapped inside the ajax tag is refreshed with the whole JSP.

    Ex. a simple page have 2 displayTag lists. If I put the ajax:displayTag wrap the whole JSP, then it work fine, if I wrap the first list, still OK, but if I wrapped only the second list, then when doing sorting, the first list is displayed twice.

    I tried it on a real JSP page with a lot of content and one displayTag list in the middle. If I wrapped the ajax:displayTag only at the displaytag list, when sorting the whole page is displayed at where the list was, the page become a big page with a same page repeated inside the list area.

    Please provide suggestion how to solve this problem.

     
    • evan yang

      evan yang - 2009-06-03

      I finally realize that I have to make the Ajax tag and displayTag list as a separate include JSP, so when the list sorting ajax event reach to the server, the server will respond with the displayTag JSP. It will be nice if any of the examples/demos has mentioned this prat (even thought it may be a fundamental design issue).

      How ever I still have problem in the code, for my page, the AjaxTag code is throwing exception:

      if (isAjaxRequest() && getHttpServletResponse().isCommitted()){
              throw new JspException("the request was flushed before");
      }

      where the getHttpServletResponse().isCommitted() is true in my case.
      I have to commented out the code, and all is working fine.
      Any ideal why?

       

Log in to post a comment.