Struts Tags Classification of Struts Tags are: Form tags. Control tags. Data tags. Ajax tags.

23
Unit – 3 Struts Tags

description

Form Tags The list of form tags is a subset of Struts UI Tags. These tags help in the rendering of the user interface required for the Struts web applications and can be categorized into three categories. Simple UI Tags. Group UI Tags. Select UI Tags.

Transcript of Struts Tags Classification of Struts Tags are: Form tags. Control tags. Data tags. Ajax tags.

Page 1: Struts Tags Classification of Struts Tags are: Form tags. Control tags. Data tags. Ajax tags.

Unit – 3

Struts Tags

Page 2: Struts Tags Classification of Struts Tags are: Form tags. Control tags. Data tags. Ajax tags.

Struts TagsClassification of Struts Tags are:

Form tags.Control tags.Data tags.Ajax tags.

Page 3: Struts Tags Classification of Struts Tags are: Form tags. Control tags. Data tags. Ajax tags.

Form Tags

The list of form tags is a subset of Struts UI Tags.

These tags help in the rendering of the user interface required for the Struts web applications and can be categorized into three categories.

Simple UI Tags. Group UI Tags. Select UI Tags.

Page 4: Struts Tags Classification of Struts Tags are: Form tags. Control tags. Data tags. Ajax tags.

Simple UI Tags.If you are aware of HTML then all the tags used are

very common HTML tags with an additional prefix s: along with each tag and different attributes.

Simple UI Tags<s:form> <s:textarea><s:div> <s:label><s:submit> <s:file><s:reset><s:text><s:textfield><s:password>

Page 5: Struts Tags Classification of Struts Tags are: Form tags. Control tags. Data tags. Ajax tags.

<s:form>Attributes Description Requiredmethod Define method “GET” or “POST” Falseaction Define action name False

</s:form>

Simple UI Tags.

Renders an input form.

Page 6: Struts Tags Classification of Struts Tags are: Form tags. Control tags. Data tags. Ajax tags.

<s:div>Attributes Description Requiredid Define ID to the particular division Falsekey Retrieve key value from the property

fileFalse

</s:div>

Simple UI Tags.

Render an HTML div.

Page 7: Struts Tags Classification of Struts Tags are: Form tags. Control tags. Data tags. Ajax tags.

<s:submit>Attributes Description Requiredid Define ID to the submit button Falsekey Retrieve key value from the property

fileFalse

value Caption of the submit button False

</s:submit>

Simple UI Tags.

Render an Submit button.

Page 8: Struts Tags Classification of Struts Tags are: Form tags. Control tags. Data tags. Ajax tags.

<s:reset>Attributes Description Requiredid Define ID to the reset button Falsekey Retrieve key value from the property

fileFalse

value Caption of the reset button False

</s:reset>

Simple UI Tags.

Render an Reset button.

Page 9: Struts Tags Classification of Struts Tags are: Form tags. Control tags. Data tags. Ajax tags.

<s:text>Attributes Description Requiredid Define ID to the text element Falsename Define TEXT to display True

</s:text>

Simple UI Tags.

Render I18n text message.

Page 10: Struts Tags Classification of Struts Tags are: Form tags. Control tags. Data tags. Ajax tags.

<s:textfield>Attributes Description Requiredname Define NAME to the text element Falsekey Retrieve key value from the property

fileFalse

label Label for the textbox Falsereadonly if true than it makes textbox as

readonlyFalse

disabled if true than it makes textbox disabled Falsesize Defines the width of the textbox FalsemaxLength Defines the maximum characters as an

inputFalse

</s:textfield>

Simple UI Tags.

Render an HTML input field of type text.

Page 11: Struts Tags Classification of Struts Tags are: Form tags. Control tags. Data tags. Ajax tags.

<s:password>Attributes Description Requiredname Define NAME to the password element Falsekey Retrieve key value from the property

fileFalse

label Label for the textbox Falsereadonly if true than it makes textbox as

readonlyFalse

disabled if true than it makes textbox disabled Falsesize Defines the width of the textbox FalsemaxLength Defines the maximum characters as an

inputFalse

</s:password>

Simple UI Tags.

Render an HTML input tag of type password.

Page 12: Struts Tags Classification of Struts Tags are: Form tags. Control tags. Data tags. Ajax tags.

<s:textarea>Attributes Description Requiredname Define NAME to the textarea element Falsekey Retrieve key value from the property

fileFalse

label Label for the textbox Falsereadonly if true than it makes textbox as

readonlyFalse

disabled if true than it makes textbox disabled Falserows Defines Height of the Textarea (default

is 2)False

cols Defines Width of the Textarea (default is 20)

False

</s:textarea>

Simple UI Tags.

Render HTML textarea tag.

Page 13: Struts Tags Classification of Struts Tags are: Form tags. Control tags. Data tags. Ajax tags.

<s:label>Attributes Description Requiredid Define ID to the label element Falselabel Define Label text False

</s:label>

Simple UI Tags.

Render a label that displays read-only information.

Page 14: Struts Tags Classification of Struts Tags are: Form tags. Control tags. Data tags. Ajax tags.

<s:file>Attributes Description Requiredname Define NAME to the file element Falselabel Define Label text False

</s:file>

Simple UI Tags.

Render a file input field.

Page 15: Struts Tags Classification of Struts Tags are: Form tags. Control tags. Data tags. Ajax tags.

Group UI Tags.The group UI tags are used to create radio

button and the checkbox. 

Group UI Tags

<s:radio> <s:checkbox>

<s:checkboxlist>

Page 16: Struts Tags Classification of Struts Tags are: Form tags. Control tags. Data tags. Ajax tags.

<s:radio>Attributes Description Requiredname Define NAME to the radio element Falselabel Define Label text Falselist Define List of Data to be selected (Only

one)True

</s:radio>Renders a radio button input field.

Group UI Tags.

Page 17: Struts Tags Classification of Struts Tags are: Form tags. Control tags. Data tags. Ajax tags.

<s:checkboxlist>Attributes Description Requiredname Define NAME to the checkbox element Falselabel Define Label text Falselist Define List of Data to be selected

(Multiple)True

</s:checkboxlist>Render a list of checkboxes .

Group UI Tags.

Page 18: Struts Tags Classification of Struts Tags are: Form tags. Control tags. Data tags. Ajax tags.

<s:checkbox>Attributes Description Requiredname Define NAME to the checkbox element Falselabel Define Label text False

</s:checkbox>

Render a checkbox input field.

Group UI Tags.

Page 19: Struts Tags Classification of Struts Tags are: Form tags. Control tags. Data tags. Ajax tags.

Select UI Tags.The Select UI tags are used to create select

options and dropdown lists. 

Select UI Tags

<s:select> <s:combobox>

<s:doubleselect>

Page 20: Struts Tags Classification of Struts Tags are: Form tags. Control tags. Data tags. Ajax tags.

<s:select>Attributes Description Requiredname Define NAME to the select element Falselabel Define Label text Falselist Define List of Data to be selected (Only

one)True

</s:select>Renders a Select element.

Select UI Tags.

Page 21: Struts Tags Classification of Struts Tags are: Form tags. Control tags. Data tags. Ajax tags.

<s:combobox>Attributes Description Requiredname Define NAME to the combobox element Falselabel Define Label text Falselist Define List of Values TrueheaderKey Define Header Key FalseheaderValue Define Header Text False

</s:combobox>

Widget that fills a text box from a select.

Select UI Tags.

Page 22: Struts Tags Classification of Struts Tags are: Form tags. Control tags. Data tags. Ajax tags.

<s:doubleselect>Attributes Description Requiredname Define NAME to the first Select element Falselabel Define Label text Falselist Define List of Data to be selected

(Multiple)True

doubleName Define NAME to the second Select element

True

doubleList Define List for the second Select True

</s:doubleselect>Renders two HTML select elements with second one changing displayed values depending on selected entry of first one.

Select UI Tags.

Page 23: Struts Tags Classification of Struts Tags are: Form tags. Control tags. Data tags. Ajax tags.

Summary

Form Tag

Simple<s:form><s:div>

<s:submit><s:reset><s:text>

<s:textfield><s:password

><s:textarea>

<s:label><s:file>

Group

<s:radio><s:checkbox>

<s:checkboxlist>

Select

<s:select><s:combobox><s:doubleselect

>