• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Knute Snortum
  • Paul Clapham
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Frits Walraven
Bartenders:
  • Ganesh Patekar
  • Tim Holloway
  • salvin francis

how to find anything changed on jsp UI, ActionForm  RSS feed

 
Ranch Hand
Posts: 148
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a button on a edit jsp(struts tags), which triggers a call to one of our external services. I want to put a check in my Action before calling service to call it only if values are changed in actionform(UI).

1)edit jsp is populated, displayed to user
2)user makes changes, clicks done.
3)done method in action calls external service

I want to compare already popoulated actionform against modified one. is there a way of doing it?? can I compare two forms in action? how?
 
Ranch Hand
Posts: 425
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Struts don't have idea on what happend at user browser. There are many ways to find out if the content of form has been changed or not
- One of the way to handle this will be to have a hidden field containing the hashcode of the concatenated string of fields in the form and validate the action form by comparing the stored hashcode and new hascode constructed from the new values.
- Or you can write Javascript to set some flag in the form to indicate user has changed atleast one entry.
 
We find this kind of rampant individuality very disturbing. But not this tiny ad:
how do I do my own kindle-like thing - without amazon
https://coderanch.com/t/711421/engineering/kindle-amazon
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!