Hi, We are currently working on a new roller theme and would like to be able to post comment asynchronously on the weblog.
It's no problem to make an asynchronous call to CommentServlet and put the comment in the database. However, displaying is a bit more tricky. Here are our thoughts, please let me know if you have any insights on which is the "right" way to go. The basic problem is that we need to refresh only the newly posted comment (or at least, the post to which it belongs). That means that upon return of the request from CommentServlet, we need to re-render this specific part of the post. I don't really know how to do that, so I was going for the following method. My idea would be to pass a new attribute to CommentServlet which would be say 'ajax', when this attribute is set, the Servlet would return only the newly posted comment content (as XML or JSON for instance), so that it can be rendered in the page. However, I'm pretty unhappy with this solution. I guess the best would be to get the servlet to render a velocity template which generates the xml, but I'm not sure how to do that: maybe have it set a parameter in the weblogmodel which states that we are just rendering a comment, and return a different pager ? Is there a way to haver it render a completely different template (than weblog.vm, I mean) ? Please let me know if you have any thoughts -- Axelle
