I want to display an user defined error message in my JSP by setting it in Struts 1.x custom handler class when some exception occurs.
For example, I have 2 classes, Category and Product. A Category can have more than 1 Product. When an user tries to insert a product with the undefined category in the database it has to throw an exception with the custom message "Category could not find in the database. Please enter valid Category for the Product to insert".
What is the best way to achieve this?
Thanks in advance.