Raible's Wiki

Raible Designs
Wiki Home
News
Recent Changes

AppFuse

Homepage
  - Korean
  - Chinese
  - Italian
  - Japanese

QuickStart Guide
  - Chinese
  - French
  - German
  - Italian
  - Korean
  - Portuguese
  - Spanish
  - Japanese

User Guide
  - Korean
  - Chinese

Tutorials
  - Chinese
  - German
  - Italian
  - Korean
  - Portuguese
  - Spanish

FAQ
  - Korean

Latest Downloads

Other Applications

Struts Resume
Security Example
Struts Menu

Set your name in
UserPreferences


Referenced by
AppFuse
AppFuse_it
AppFuse_jp
AppFuse_zh
DevelopmentEnvironme...
DevelopmentEnvironme...
DevelopmentEnvironme...
DevelopmentEnvironme...
Downloads
LeftMenu
...and 14 more




JSPWiki v2.2.33

[RSS]


Hide Menu

StrutsResume


Difference between version 31 and version 30:

At line 3 added 1 line.
!!__2003.10.30__ - Thank you for struts-resume
At line 5 added 44 lines.
Hi Matt,
Kudos on your excellent work on appfuse and struts-resume. Since, I've been using appfuse and struts-resume to gather a basic understanding of struts and "helper" technologies, its time to give back a little.
I ran into the same problem as yourself, as per [your email|http://www.mail-archive.com/[email protected]/msg60169.html]. So, I followed the email thread and wasn't quite happy with the JavaScript solution. So, I conjured a non-JavaScript solution which is posted below. Be aware that my struts understanding is fairly rudimentary and this might be a classic example of too much blending of V into the C from the MVC model.
----
This is part of action.BaseForm
----
{{{
public ActionErrors validate(ActionMapping mapping,
HttpServletRequest request) {
// Identify the request parameter containing the method name
String parameter = mapping.getParameter();
if( parameter != null ) {
// Identify the method name to be dispatched to.
String name = request.getParameter(parameter);
MessageResources resources =
(MessageResources) request.getAttribute(Globals.MESSAGES_KEY);
// Identify the localized message for the cancel button
String message = resources.getMessage("button.cancel");
// if message resource matches the cancel button then no
// need to validate
if( name != null && name.equals(message) ) {
if( log.isDebugEnabled() ) {
log.debug(mapping.getAttribute() + " '" + name +
"' method, so no need to validate");
return null;
}
}
}
// perform regular validation
return super.validate(mapping, request);
}
}}}
What do you think of this approach?
Regards,\\
--\\
Haroon Rafique [email protected] (reverse the domain to send email)

Back to StrutsResume, or to the Page History.