GeeCON Prague 2014*
The moose likes Struts and the fly likes Error +adding a message Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Error +adding a message" Watch "Error +adding a message" New topic
Author

Error +adding a message

A knibbs
Ranch Hand

Joined: Aug 23, 2006
Posts: 158
Hi all I want to be able to add some information to my error messages. In particular what I want to be able to do is to add a tracking number so that if they contact someone asking for help with a particular issue I can go back in the logs and find what occurred with that tracking number. I was thinking of storing the value in a session variable and displaying that on the page, but I was curious if there was better more effective ways of doing this.
The errors are in cases when exceptions have been caught, such as a piece of information missing, I want to throw an exception which is dealt with in struts-config.xml.

thanks in advance for any thoughts or suggestions.
Brent Sterling
Ranch Hand

Joined: Feb 08, 2006
Posts: 948
One thing that I have done recently is to update my applications error page to include the current date and time. They way if a user submits a screen capture we at least have a place in the logs to start.

- Brent
A knibbs
Ranch Hand

Joined: Aug 23, 2006
Posts: 158
Originally posted by Brent Sterling:
One thing that I have done recently is to update my applications error page to include the current date and time. They way if a user submits a screen capture we at least have a place in the logs to start.

- Brent

Is there a way to include dynamic information? Basically I want to be able to pass in a string that will be thrown by the exception. (The string will be modified so that the message is something that makes sense to the user.)

Is this something that is difficult to do or is it so simple that I haven't explained it well ?

Thanks again for taking the time to read my post.
It is much appreciated.
 
GeeCON Prague 2014
 
subject: Error +adding a message