The drop-down box is a particularly common HTML component. It is also a more complex TAG in Struts. If you want to realize how MV separation learn how to use tags, it is very important, of course, if it is a high person, there is no problem with yourself. ^ _ ^ On a page of recently used to pull the box, I want to take this opportunity to learn how to use the label to get MV to be separated, so determined that you must put the dunk box in a bean , Then call the bean by tag, then use
Ok, this will be perfectly separated by MV. It looks like a short a few lines of code, but I really gave me confused.
Let me write my own summary in this study process, share your sharing:
At first I didn't use the OptionsCollection tag, but the Options tag used, because it used to have been used, but it is a bit indecent, and many Java code is directly written directly to the page, especially when the pull box is very much. Very uncomfortable. It's really because I haven't done it last time, this time I am determined to be fine.
This tag differs from the
Attribute NameDescriptionfilterSet to false if you do NOT want the option labels filtered for sensitive characters in HTML. By default, such values are filtered. [RT Expr] labelThe property of the bean within the collection which represents the label to be rendered for each option. Defaults to "label". [RT Expr] nameThe attribute name of the bean whose properties are consulted when rendering the current value of this input field. If not specified, the bean associated with the form tag we are nested within is utilized. [RT Expr] propertyThe property of the form bean, or the bean specified by the name attribute, that will return the collection of objects to be rendered for these options. [RT Expr] styleCSS styles to be applied to this HTML element. [RT Expr] styleClassCSS stylesheet class to be applied to this HTML element (renders a "class" attribute). [RT Expr] valueThe property of the bean within the collection which represents the value to be rendered for each option. Defaults to "va "[rt expr]
Another point is that the same starters like me, must have something to go.
Http://struts.apache.org/userguide/ Take a look at the above documents, I can help us solve a lot of confusion, I used to not see very much, I feel that there is nothing necessary, but I feel very necessary. .