throw exception as response from Spring handleRequest method
===

I have a scenario in Spring MVC , where I have to throw an Exception explicitly in the handleRequest Method. 

For Eg.

    public class AdminController implements Controller {

	public ModelAndView handleRequest(HttpServletRequest request,
			HttpServletResponse response) throws Exception {

       // for some request parameter this is run. For Eg. reqParam=xyz
        undeployTables();
    }

    public void undeployTables() throws Exception {
          throw new Exception("Undeploy Exception");

         }

Now assuming that spring servlet and url mapping is configured in web.xml, when i try to access the servlet via url  <code>http://localhost:8080/server/admin?reqParam=xyz</code>, I get an correct error on page. <code>java.lang.Exception: Undeploy failed.... </code>

But when I try to access the code via HTTPClient, that is via the java code the response in the client is not able to catch this exception and only I get is the HTTP 401 Internal Error as response object.But what i would Like to have is an Exception object in client.

 Can you please let me know where the changes should be done so that the exception on the Client could be caught.

I could google but couldnt find a appropriate answer.

