I\'m new to java and I\'m not that familiar with the formatting rules used by an error stack trace when it is thrown and subsequently displayed to an end-user of my web appl
Do not show the exception message / stacktrace directly to the end user. Instead try and use an Exception - Message mapping approach.
For example:
SQLException - Sorry, a database error occurred. Please try again laterRuntimeException / Exception - Sorry an error occurred. Please try again laterIn fact, you can make it as generic as possible. Perhaps you could use a custom error code mapping. For instance, E0001 for SQLException, E0000 for Exception and so on and display this to the end user. This will be helpful when they eventually contact the customer service with the error code.