• 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
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

using same name for many buttons

 
Ranch Hand
Posts: 401
Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

my application/module contains 5 jsps running in struts and in which i have around 10 buttons. i declared only one variable in formbean and used same name for most of the buttons. will it create any problemin real time using by client?.

I do not want to create getters and setters for each and every button.. so i have done like this.

regards,

rahul.
 
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's fine to use the same property for multiple buttons. When the form is submitted, whatever is in the value attrubute of the <html:submit> tag will populate the property, so make sure you specify a different value for each button.
 
Rauhl Roy
Ranch Hand
Posts: 401
Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thank you very much for the prompt reply.

the module i am working on contains 5 jsp pages and all of them have next and back buttons and i have to use the same value name in order to show the name required according to the usertrequirement.

[ means, if first contains next, cancel buttons i have to use same names and my second jsp contais all three next, back, cancel and so on]
for cancel i used <html:cancel/><html:submit for both next and back in all pages>
can you please tell me, if i have to change some thing in my code.

rahul
[ June 21, 2007: Message edited by: Rauhl Roy ]
 
Merrill Higginson
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When I said you had to specify a different value for each button, I meant within the same JSP. There's no problem with having the same value in one JSP as that used in another JSP even if you're using the same form bean.
 
reply
    Bookmark Topic Watch Topic
  • New Topic