Change your loop to be: int i;
 while ((i=in.read())>) {
   out.write(i);
 }

available() - "Returns the number of bytes that can be read (or skipped over) from this input stream without blocking by the next caller of a method for this input stream." So its not an accurate gauge of how much content is available from the client.


-Tim


Kyle Brantley wrote:
I'm honestly not sure (being an entire day into tomcat servlets), but I don't believe so.


Full code:

public class Frontend extends HttpServlet {

public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        PrintWriter out = response.getWriter();
        InputStream in = request.getInputStream();
        response.setContentType("text/xml");
        response.setCharacterEncoding("UTF-8");
        response.setStatus(HttpServletResponse.SC_OK);
while (in.available() > 0)
            out.write(in.read());
    }
}


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to