Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Struts 2 - implementing warning functionality

 
Robert Atchison
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello, I'm trying to get some ideas and best practices for implementing warning functionality in an application. I want to validate user input and inform (warn) the user of possible problems, and allow the user to 'okay' the update despite warnings.

I was curious if anyone else had already crossed this path and could offer some advice. Any help will be appreciated.

Thanks!
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That's a pretty broad question. So far you're just describing generic validation, which is supported by any reasonable web framework, including S2.
 
Robert Atchison
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Validation in S2 is it's an error or it's not (as I understand it). If validation fails the user must correct some data. I need to warn the user of some business condition; something like 'acct up to date, do you really want to close acct?' Nothing wrong with data, no real errors, just something the user needs to confirm before proceeding.

Using S1 my group created a custom request processor that called custom method on the form called validateWarning(). JSP included script to throw popup with warning message (if present) for user to confirm or cancel. If user confirmed a flag to ignore warning was set and the validateWarning() method was skipped. I will need to do something similar in my S2 app.
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So, do the same thing--expose an action property, and act on it in the same way. I'm not sure why a request processor would come in to play, but that's a different issue.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic