• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

using same name for many buttons

 
Rauhl Roy
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.
 
Merrill Higginson
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic