hi! I have a problem in refreshing a page when an application exception is thrown. I have a jsp where in if user enters a year and month and presses submit button then a pdf report is generated and acrobat reader open dialog box pops-up, but if data doesnt exists for that year and month then an application exception thrown and is shown in same jsp.
Scenario: If user enters year and month for which data doesnt exists then application exception is shown in the page correctly , but after that if he gives valid input then pdf is generated but this jsp is not refreshed as a result the error for previous input is not wiped out... this is happening because when there is no error , i am returning success in my action and for success i have a forward action in my struts-config which opens pdf in a new jsp and it doesnt return this jsp and this jsp is not reloaded. can anyone give me a solution where in for the same forward parameter i can refresh this input jsp as well as open pdf in another jsp.
I think I would actually avoid solving this and make the error message include the incorrect month and day in its display.
A good workman is known by his tools.
Joined: Jun 29, 2005
I think u have not correctly understood my difficulty.My problem is not with displaying the error Message , but to wipe out when the correct month is given(that is refreshing this page) which is not possible now bcoz action is redirected to open pdf rather than this page...
Explanation for my previous post: You want this solution because you do not want to confuse the user with an error on a successful submission. My point was that it would be much easier to avoid the confusion by being very specific in the error message so that the user can compare the error's month/day to what they entered and see that the error was from a previous submission.
Joined: Jun 29, 2005
Thanx Marc.. What i thought was to redirect to same jsp when submit is clicked and check the action path or set some flag which tells submit was successful and then forward it to JSP which will open PDF.
If u have any other better idea then plz do post it.
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com