This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Struts and the fly likes Safe to have multiple Struts inputs with same name? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Safe to have multiple Struts inputs with same name?" Watch "Safe to have multiple Struts inputs with same name?" New topic
Author

Safe to have multiple Struts inputs with same name?

Erich Kilmer
Greenhorn

Joined: Sep 14, 2004
Posts: 1
I have a page that shows widget data. This data lives on 4 different tabbed sections which a swapped in and out.
Also above the tabbed region is a pull down that allows user to choose from 4 widget types.
One of the tabbed areas changes for each of the different types. This area has a couple of inputs in common and several which are not.
Since this thing is tabbed all of the inputs exist on the page at the same time its just that they are not all visible at the same time.
My first question is this for the inputs that are in common in the dynamic tabbed region can they all reference by the "name" attribute the same field in the action form? Or is this dangerous.
Also if this is possible when you first intialize the page from the action form if more than input has the same name will they all be initialized from the form by Struts?
Or should each input have a unique name?
I know this seems weird but this is the design issues that I am struggling with for this project.
TIA
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Safe to have multiple Struts inputs with same name?
 
Similar Threads
Same Form, More than Once
Which Framework best fits these features...?
Call and return pattern required
Validator help for shared form bean
about struts