How to return an object to the user in the java server programming
<p>I have a java servelet segment, which can generate a XML file and print it out on the screen.</p>

<p>The related code are giving as follows</p>

<pre><code>public void handle(String target,
                   Request baseRequest,
                   HttpServletRequest request,
                   HttpServletResponse response) 
    throws IOException, ServletException
{
    response.setContentType("text/html;charset=utf-8");
    response.setStatus(HttpServletResponse.SC_OK);
    baseRequest.setHandled(true);

          // some code to generate process

             PrintWriter out = response.getWriter();
     // the object of “process” is serialized to generate XML file
     process.serialize(out);
     out.println(process);
     out.close();            
</code></pre>

<p>}</p>

<p>Right now, I  need to return this process object to the user, how should I do that? Thanks.</p>
