• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Problem refreshing page

 
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
pie sneak
Posts: 4727
Mac VI Editor Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
That's a tough one.

I think I would actually avoid solving this and make the error message include the incorrect month and day in its display.
 
Rashmini Palakurti
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi!

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...
 
Marc Peabody
pie sneak
Posts: 4727
Mac VI Editor Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I understood your problem. I just don't think there is an elegant way to solve it. You'd have to do something tricky with javascript or redirects. For instance, make the error text non-displayable when the submit button gets clicked.

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.
 
Rashmini Palakurti
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic