Read the server.log file.
Use debug facilities of your IDE.
Include debug messages using java.util.logging.Logger.
Return error pages to the client with detailed data.
Look at the HTML source of the resulting web pages.