Win a copy of TDD for a Shopping Website LiveProject this week in the Testing forum!
  • 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
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

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.
 
If you are using a wood chipper, you are doing it wrong. Even on this tiny ad:
free, earth-friendly heat - a kickstarter for putting coin in your pocket while saving the earth
https://coderanch.com/t/751654/free-earth-friendly-heat-kickstarter
reply
    Bookmark Topic Watch Topic
  • New Topic