It depends on what your AJAX request expects in answer.
if it expects JSON/XML/other non-HTML stuff, then you should use
PrintWriter
to write that stuff to HTTP response.if it expects HTML content (inserts received content into your page), then you could forward from your action to JSP file, which will contain just the HTML fragment you want to return.