Home » struts-2.1.8.1-src » org.apache » struts2 » components »

org.apache.struts2.components

Sub Packages:

org.apache.struts2.components.table    
org.apache.struts2.components.table.renderer   JSP UI tags for rendering table output in HTML.  
org.apache.struts2.components.template    

Interfaces:

ExtraParameterProvider     code | html
Param.UnnamedParametric   Tags can implement this to support nested param tags without the name attribute.  code | html
RemoteUICallBean     code | html
UrlProvider   Implemntations of this interface can be used to build a URL  code | html
UrlRenderer   Implementations of this interface are responsible for rendering/creating URLs for a specific environment (e.g.  code | html

Abstract Classes:

AbstractRemoteCallUIBean   TODO: Document AbstractRemoteCallUIBean.  code | html
ClosingUIBean   ClosingUIBean is the standard superclass for UI components such as div etc.  code | html
ContextBean   Base class for control and data tags  code | html
DoubleListUIBean   DoubleListUIBean is the standard superclass of all Struts double list handling components.  code | html
FormButton   FormButton.  code | html
ListUIBean   DoubleListUIBean is the standard superclass of all Struts list handling components.  code | html
UIBean   UIBean is the standard superclass of all Struts UI componentns.  code | html

Classes:

ActionComponent  

This tag enables developers to call actions directly from a JSP page by specifying the action name and an optional namespace. 

code | html
ActionError   Render action errors if they exists the specific layout of the rendering depends on the theme itself.  code | html
ActionMessage   Render action messages if they exists, specific rendering layout depends on the theme itself.  code | html
Anchor  

A tag that creates a HTML <a >.This tag supports the same attributes as the "url" tag, including nested parameters using the "param" tag.

Examples


<s:a id="link1" theme="ajax" href="/DoIt.action">
    <img border="none" src="<%=request.getContextPath()%>/images/delete.gif"/>
    <s:param name="id" value="1"/>
</s:a>

 
code | html
AppendIterator  

Component for AppendIteratorTag, which jobs is to append iterators to form an appended iterator whereby entries goes from one iterator to another after each respective iterator is exhausted of entries.

For example, if there are 3 iterator appended (each iterator has 3 entries), the following will be how the appended iterator entries will be arranged:

  1. First Entry of the First Iterator
  2. Second Entry of the First Iterator
  3. Third Entry of the First Iterator
  4. First Entry of the Second Iterator
  5. Second Entry of the Second Iterator
  6. Third Entry of the Second Iterator
  7. First Entry of the Third Iterator
  8. Second Entry of the Third Iterator
  9. Third Entry of the Third ITerator
  • id (String) - the id of which if supplied will have the resultant appended iterator stored under in the stack's context
public class AppendIteratorTagAction extends ActionSupport { private List myList1; private List myList2; private List myList3; public String execute() throws Exception { myList1 = new ArrayList(); myList1.add("1"); myList1.add("2"); myList1.add("3"); myList2 = new ArrayList(); myList2.add("a"); myList2.add("b"); myList2.add("c"); myList3 = new ArrayList(); myList3.add("A"); myList3.add("B"); myList3.add("C"); return "done"; } public List getMyList1() { return myList1; } public List getMyList2() { return myList2; } public List getMyList3() { return myList3; } } <s:append var="myAppendIterator"> <s:param value="%{myList1}" /> <s:param value="%{myList2}" /> <s:param value="%{myList3}" /> </s:append> <s:iterator value="%{#myAppendIterator}"> <s:property /> </s:iterator>  
code | html
Autocompleter  

The autocomplete tag is a combobox that can autocomplete text entered on the input box. 

code | html
Bean  

Instantiates a class that conforms to the JavaBeans specification. 

code | html
Checkbox   Renders an HTML input element of type checkbox, populated by the specified property from the ValueStack.  code | html
CheckboxList   Creates a series of checkboxes from a list.  code | html
ComboBox   The combo box is basically an HTML INPUT of type text and HTML SELECT grouped together to give you a combo box functionality.  code | html
Component   Base class to extend for UI components.  code | html
ComponentUrlProvider   Default implementation of UrlProvider  code | html
Date   Format Date object in different ways.  code | html
DateTimePicker  

Renders a date/time picker in a dropdown container. 

code | html
Debug     code | html
Debug.DebugMapEntry     code | html
Div   Creates an HTML <div>   code | html
DoubleSelect   Renders two HTML select elements with second one changing displayed values depending on selected entry of first one.  code | html
Else  

Perform basic condition flow. 

code | html
ElseIf  

Perform basic condition flow. 

code | html
FieldError   Render field errors if they exists.  code | html
File   Renders an HTML file input element.  code | html
Form  

Renders HTML an input form.

The remote form allows the form to be submitted without the page being refreshed. 

code | html
GenericUIBean   Renders an custom UI widget using the specified templates.  code | html
Head   Renders parts of the HEAD section for an HTML file.  code | html
Hidden   Renders an HTML input element of type hidden, populated by the specified property from the ValueStack.  code | html
I18n   Gets a resource bundle and place it on the value stack.  code | html
If  

Perform basic condition flow. 

code | html
Include  

Include a servlet's output (result of servlet or a JSP page).

Note: Any additional params supplied to the included page are not accessible within the rendered page through the <s:property...> tag since no valuestack will be created. 

code | html
Include.PageOutputStream   Implementation of ServletOutputStream that stores all data written to it in a temporary buffer accessible from #getBuffer() code | html
Include.PageResponse   Simple wrapper to HTTPServletResponse that will allow getWriter() and getResponse() to be called as many times as needed without causing conflicts.  code | html
InputTransferSelect   Create a input transfer select component which is basically an text input and <select ...> tag with buttons in the middle of them allowing text to be added to the transfer select.  code | html
IteratorComponent  

Iterator will iterate over a value. 

code | html
IteratorComponent.CounterIterator     code | html
Label   Renders an HTML LABEL that will allow you to output label:name combination that has the same format treatment as the rest of your UI controls.

Examples

In this example, a label is rendered. 

code | html
MergeIterator  

Component for MergeIteratorTag, which job is to merge iterators and successive call to the merged iterator will cause each merge iterator to have a chance to expose its element, subsequently next call will allow the next iterator to expose its element. 

code | html
OptGroup   Create a optgroup component which needs to resides within a select tag.  code | html
OptionTransferSelect   Create a option transfer select component which is basically two <select ...> tag with buttons in the middle of them allowing options in each of the <select ...> to be moved between themselves.  code | html
Param  

This tag can be used to parameterize other tags.

The include tag and bean tag are examples of such tags. 
code | html
Password   Render an HTML input tag of type password.

Examples

In this example, a password control is displayed. 

code | html
PortletUrlRenderer   Implementation of the UrlRenderer interface that renders URLs for portlet environments.  code | html
Property   Used to get the property of a value, which will default to the top of the stack if none is specified.  code | html
Push  

Push value on stack for simplified usage.

  • value* (Object) - value to be pushed into the top of the stack

Examples


<s:push value="user">
    <s:propery value="firstName" />
    <s:propery value="lastName" />
</s:push>

Pushed user into the stack, and hence property tag could access user's properties (firstName, lastName etc) since user is not at the top of the stack

 <s:push value="myObject">                              ----- (1)
      <s:bean name="jp.SomeBean" var="myBean"/>        ----- (2)
         <s:param name="myParam" value="top"/>        ----- (3)
      </s:bean>
  </s:push>


when in (1), myObject is at the top of the stack
when in (2), jp.SomeBean is in the top of stack, also in stack's context with key myBean
when in (3), top will get the jp.SomeBean instance


<s:push value="myObject">                                       ---(A)
   <s:bean name="jp.SomeBean" var="myBean"/>                   ---(B)
      <s:param name="myParam" value="top.mySomeOtherValue"/>  ---(C)
   </s:bean>
</s:push>


when in (A), myObject is at the top of the stack
when in (B), jp.SomeBean is at the top of the stack, also in context with key myBean
when in (C), top refers to jp.SomeBean instance. 
code | html
Radio   Render a radio button input field.

Examples

In this example, a radio control is displayed with a list of genders. 

code | html
Reset   Render a reset button.  code | html
Select   Render an HTML input tag of type select.  code | html
ServletUrlRenderer   Implementation of the UrlRenderer interface that creates URLs suitable in a servlet environment.  code | html
Set  

The set tag assigns a value to a variable in a specified scope. 

code | html
Submit   Render a submit button.  code | html
TabbedPanel   The tabbedpanel widget is primarily an AJAX component, where each tab can either be local content or remote content (refreshed each time the user selects that tab).

If the useSelectedTabCookie attribute is set to true, the id of the selected tab is saved in a cookie on activation. 
code | html
Text   Render a I18n text message.  code | html
TextArea   Render HTML textarea tag.

Examples


<s:textarea label="Comments" name="comments" cols="30" rows="8"/>

 
code | html
TextField   Render an HTML input field of type text

Examples

In this example, a text control for the "user" property is rendered. 

code | html
Token   Stop double-submission of forms.

The token tag is used to help with the "double click" submission problem. 
code | html
Tree   Renders a tree widget with AJAX support.

The id attribute is normally specified, such that it could be looked up using javascript if necessary.

Examples



<-- statically -->
<s:tree id="..." label="...">
   <s:treenode id="..." label="..." />
   <s:treenode id="..." label="...">
       <s:treenode id="..." label="..." />
       <s:treenode id="..." label="..." />
   &;lt;/s:treenode>
   <s:treenode id="..." label="..." />
</s:tree>

<-- dynamically -->
<s:tree
         id="..."
         rootNode="..."
         nodeIdProperty="..."
         nodeTitleProperty="..."
         childCollectionProperty="..." />


 
code | html
TreeNode   Renders a tree node within a tree widget with AJAX support.

Either of the following combinations should be used depending on if the tree is to be constrcted dynamically or statically. 

code | html
URL  

This tag is used to create a URL.

You can use the <param> tag inside the body to provide additional request parameters. 

code | html
UpDownSelect   Create a Select component with buttons to move the elements in the select component up and down.  code | html