• 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

ParameterMethodNameResolver

 
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I am trying to implement ParameterNameMethodResolver and MultiActionController objects to handle the form containing multiple submit buttons.
As part of configuration file, I have


And jsp file contains several submit buttons like

According to ParameterMethodNameResolver's api,


...
The second resolution strategy is primarily expected to be used with web pages containing multiple submit buttons. The 'name' attribute of each button should be set to the mapped method name, while the 'value' attribute is normally displayed as the button label by the browser, and will be ignored by the resolver.
...



However, clicking on submit buttons, the form always uses both name/value attributes of button for composing name/value parameter. That is, I always get .../load.htm?showAll=Show+All or .../load.htm?show=Show or .../load.htm?signoff=Sign+Off. Instead, I am expecting something like .../load.htm?action=Show+All or .../load.htm?action=Show, etc.

I must be implementing it incorrectly.
My head is hurt. Please help!
Frank
 
Sheriff
Posts: 14691
16
Eclipse IDE VI Editor Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think that you have to set methodParamNames to use it :


 
Frank Truong
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

Now, it does invoke the proper method. But it continues to use name/value attribute of submit button for name/value parameter regardless of 'paramName' property(default is 'action') I have set on ParameterMethodNameResolver bean.

Frank

 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE VI Editor Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think that in this case it doesn't use the paramName at all.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic