Struts 2 s:datetimepicker UI tag

<s:datetimepicker>: The <s:datetimepicker> tag is a dojo ajax tag and create a text box with a calendar icon. When calendar icon is clicked it will open the date time picker component. Syntax: <sx:datetimepicker name=”fieldName” label=”fieldLabel” displayFormat=”dateFormat”/> Note: Add <sx:head /> in the head element of your jsp. Example: test.jsp <%@ taglib uri="/struts-tags" prefix="s"%> <%@ taglib … Read more

Struts 2 s:optiontransferselect UI tag

<s:optiontransferselect>: The <s:optiontransferselect> tag is used to create the option transfer select component which is the combination of two updownselect components. It contains the buttons to move the selected items between the two updownselect components. Syntax: <s: optiontransferselect name=”firstDropDownName” list=”firstDropDownValueList” doubleName=”secondDropDownName” doubleList=”secondDropDownValueList” /> Example: index.jsp <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title>Struts … Read more

Struts 2 s:updownselect UI tag

<s:updownselect>: The <s:updownselect> tag is used to create a HTML select component with the two buttons. These buttons are used to move up and down the select items in the select component. After the form submission all selected values can be get in the same order as they are arranged. Syntax:  <s:updownselect list=”valueList” name=”fieldName” headerKey=”firstItemValue” … Read more

Struts 2 s:doubleselect UI tag

<s:doubleselect>: The <s:doubleselect> tag is used to create two HTML drop down list boxes. Second drop down values changed automatically when any value of the first drop down list is selected. Syntax: <s:doubleselect name=”firstDropDownName” list=”firstDropDownValueList” doubleName=”secondDropDownName” doubleList=”secondDropDownValueList” /> Example: test.jsp <%@ taglib uri="/struts-tags" prefix="s"%> <html> <head> <title>Struts 2 s:doubleselect UI tags example</title> </head> <body> <h3>This … Read more

Struts 2 s:file UI tag

<s:file>: The <s:file> tag is used to create a HTML file upload component to browse and select a file from your machine and upload it to the server. Syntax: <s:file name=”fileName” label=”fieldLabel”/> Note: The FileUploadInterceptor is responsible for the whole functionality of s:file. It intercepts the user request with “multipart/form-data” enctype and automatically saves the … Read more

Struts 2 s:combobox UI tag

<s:combobox>: The <s:combobox> tag is used to create a HTML drop down list box which is grouped with a single line text box. User can type the value directly in the text box or select the value from the drop down list. If value is selected from the drop down list then selected value will … Read more

Struts 2 s:select UI tag

<s:select>: The <s:select> tag is used to create a HTML drop down list box. Syntax: <s:select label=”fieldLabel” headerKey=”firstItemValue” headerValue=”firstItem” list=” selectList” name=”fieldName” /> Example: index.jsp <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title>Struts 2 s:select UI tags example</title> <META HTTP-EQUIV="Refresh" CONTENT="0;URL=initializeList.action"> </head> <body> </body> </html><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> … Read more

Struts 2 s:checkbox and s:checkboxlist UI tag

<s:checkbox>: The <s:checkbox> tag is used to create a HTML checkbox. Syntax: <s:checkbox name=”fieldName” fieldValue=”true/false” label=”fieldLabel”/> <s:checkboxlist>: The <s:checkboxlist> tag is used to create the multiple checkbox with the same name. Syntax: <s:checkboxlist label=”fieldLabel” list=”valueList” name=”fieldName” value=”defaultValue” /> Note: Multiple selected values can be stored in a String array or String object. In case of … Read more

Struts s:radio 2 UI tag

<s:radio>: The <s:radio> tag is used to create a HTML radio button. Syntax: <s:radio label=”fieldLabel” name=”fieldName” list=”valueList”/> Example: index.jsp <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title>Struts 2 s:radio UI tags example</title> <META HTTP-EQUIV="Refresh" CONTENT="0;URL=initializeList.action"> </head> <body> </body> </html><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title>Struts 2 s:radio UI tags example</title> … Read more

Struts 2 s:textarea UI tag

<s:textarea>: The <s:textarea> is used to create a HTML textarea field. Syntax: <s:textarea label=”fieldLabel” name=”fieldName” cols=”noOfColumns” rows=”noOfRows”/> Example: test.jsp <%@ taglib uri="/struts-tags" prefix="s"%> <html> <head> <title>Struts 2 s:textarea UI tags example</title> </head> <body> <h3>This is a s:textarea UI tags example.</h3>   <s:property value="message" /> <br/>   <s:form action="Test"> <s:textarea label="About me" name="aboutMe" cols="30" rows="5"/> <s:submit … Read more