This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line!
See this thread for details.
The moose likes Struts and the fly likes Checking for form changes Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Frameworks » Struts
Reply Bookmark "Checking for form changes" Watch "Checking for form changes" New topic
Author

Checking for form changes

Gran Roguismo
Ranch Hand

Joined: Mar 10, 2005
Posts: 77
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.


EOL
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
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.


Merrill
Consultant, Sima Solutions
Gran Roguismo
Ranch Hand

Joined: Mar 10, 2005
Posts: 77
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.
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: Checking for form changes
 
Similar Threads
Is the HttpSession per Tomcat session or per client?
send bean from servlet to jsp
doubt in session
Confused about getSession
Why am I always getting a new session *