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