status « Message « JSP-Servlet Q&A

1. How can I display a status message while a file is uploading?

Can any one give a simple method using JavaScript to display a status message while file is uploading and fade away when file is uploaded?

2. How to properly send an HTTP message to the client

I'm working on a RESTful web service in Java. I need a good way to send error messages to the client if something's wrong. According to the Javadoc, HttpServletResponse.setStatus(int ...