• 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

Checking for form changes

 
Ranch Hand
Posts: 77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am generating reports of a decent size and so it becomes important that I don't requiry the db every time I move onto a page, it would really slow down movement on the site.
So I have decided to take my form and put it into session as "oldReportForm" during the next call to the action I call it back out of the session, I compare and if anything has changed, I run my query.

the problem is this: Every time I compare oldReportForm has already been changed to match the current reportForm. I don't understand why though.
I am not doing request.getSession().setAttribute("oldReportForm", rf); anywhere else, and I take it out before I actually set it.

Also, if you have any suggestions for doing what I want in a better way, then they would be greatly appreciated.
 
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If you've changed the scope of the Form to "session" in the Struts config file, it is being kept in the session by Struts.
 
Gran Roguismo
Ranch Hand
Posts: 77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
currently the reportForm is being set to session in the struts config. The oldReportForm is not part of the config at all, so wouldn't be effected to my thinking.
I'm a little confused by your post though.
 
reply
    Bookmark Topic Watch Topic
  • New Topic