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