Struts


What is Struts?
Struts  is open source implementation of MVC (Model-View-Controller) pattern for the development of web based applications .Struts combines Java Servlets, Java Server Pages, custom tags, and message resources into a unified framework.
What are the core classes of the Struts Framework?
Ans: Core classes of Struts Framework are ActionForm, Action, ActionMapping, ActionForward, ActionServlet etc.
What is ActionServlet?
A:
The class org.apache.struts.action.ActionServlet is the called the ActionServlet. In the Jakarta Struts Framework this class plays the role of controller. All the requests to the server goes through the controller. Controller is responsible for handling all the requests.
ActionServlet is configured as Servlet in the web.xml file.
web.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app>
     <display-name>Sample</display-name>
 <servlet>
        <servlet-name>action</servlet-name>
          <servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
                <init-param>
                      <param-name>config</param-name>
                      <param-value>/WEB-INF/struts-config.xml</param-value>
                 </init-param>
                <load-on-startup>1</load-on-startup>
  </servlet>

  <servlet-mapping>
    <servlet-name>action</servlet-name>
    <url-pattern>*.do</url-pattern>
  </servlet-mapping>

  <mime-mapping>
    <extension>html</extension>
    <mime-type>text/html</mime-type>
  </mime-mapping>

  <welcome-file-list>
        <welcome-file>index.html</welcome-file>
  </welcome-file-list>      
   
  <taglib>
    <taglib-uri>/WEB-INF/struts-bean.tld</taglib-uri>
    <taglib-location>/WEB-INF/struts-bean.tld</taglib-location>
  </taglib>
  <taglib>
    <taglib-uri>/WEB-INF/struts-html.tld</taglib-uri>
    <taglib-location>/WEB-INF/struts-html.tld</taglib-location>
  </taglib>
  <taglib>
    <taglib-uri>/WEB-INF/struts-logic.tld</taglib-uri>
    <taglib-location>/WEB-INF/struts-logic.tld</taglib-location>
  </taglib>
  <taglib>
    <taglib-uri>/WEB-INF/struts-tiles.tld</taglib-uri>
    <taglib-location>/WEB-INF/struts-tiles.tld</taglib-location>
  </taglib>
  <taglib>
    <taglib-uri>/WEB-INF/struts-nested.tld</taglib-uri>
    <taglib-location>/WEB-INF/struts-nested.tld</taglib-location>
  </taglib>
</web-app>
The above mapping maps all the requests ending with .do to the ActionServlet. ActionServlet uses the configuration defined in struts-config.xml file to decide the destination of the request. Action Mapping Definitions is used to map any action.
What are the important tags of struts-config.xml ?
1:<?xml version="1.0" encoding="ISO-8859-1" ?>
2:
3:<!DOCTYPE struts-config PUBLIC
4:"-//Apache Software Foundation//DTD Struts Configuration 1.3//EN"
5:"http://struts.apache.org/dtds/struts-config_1_3.dtd">
6:
7:<struts-config>
8:   
9:    <global-forwards>
10:        <forward name="list" path="/list.do"/>
11:    </global-forwards>
12:    
13:    <form-beans>
14:        <form-bean name="listForm" type="web.DefectsListForm" />
15:        <form-bean name="actionForm" type="web.DefectsActionForm" />
16:    </form-beans>
17:    
18:    <action-mappings>
19:        <action
20:            path="/list"
21:            name="listForm"
22:            scope="request"
23:            type="web.DefectsList"
24:            validate="false">
25:            <forward name="list" path="/pages/defects.jsp" />
26:        </action>
27:        <action
28:            path="/action"
29:            name="actionForm"
30:            scope="request"
31:            type="web.DefectsAction"
32:            parameter="method"
33:            validate="false">
34:            <forward name="edit" path="/pages/editDefect.jsp" />
35:            <forward name="add" path="/pages/addDefect.jsp" />
36:            <forward name="list" path="/list.do" redirect="true" />
37:        </action>
38:    </action-mappings>
39:    
40:    <message-resources parameter="MessageResources" />
41:    
42:    <plug-in className="org.apache.struts.validator.ValidatorPlugIn">
43:        <set-property
44:            property="pathnames"
45:            value="/org/apache/struts/validator/validator-rules.xml,
46:        /WEB-INF/validation.xml"/>
47:    </plug-in>
48:    
49:</struts-config>
 
What is Action Class?
The Action Class is part of the Model and is a wrapper around the business logic. The purpose of Action Class is to translate the HttpServletRequest to the business logic. To use the Action, we need to subclass and overwrite the execute() method. In the Action Class all the database/business processing are done. It is advisable to perform all the database related stuffs in the Action Class. The ActionServlet (commad) passes the parameterized class to Action Form using the execute() method. The return type of the execute method is ActionForward which is used by the Struts Framework to forward the request to the file as per the value of the returned ActionForward object.
Here is the code of Action Class that returns the ActionForward object.

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.struts.action.Action;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
public class TestAction extends Action
{
  public ActionForward execute(
    ActionMapping mapping,
    ActionForm form,
    HttpServletRequest request,
    HttpServletResponse response) throws Exception
   {
      return mapping.findForward("success");
   }
}
What is ActionForm Class?
An ActionForm is a JavaBean that extends org.apache.struts.action. ActionForm. ActionForm maintains the session state for web application and the ActionForm object is automatically populated on the server side with data entered from a form on the client side.
Ex:-
package com.sample;
import javax.servlet.http.HttpServletRequest;
import org.apache.struts.action.*;
import org.apache.struts.validator.ValidatorActionForm;

public class LoginForm extends ValidatorActionForm
{
  private String username=null;
  private String password=null; 

 public String getUsername() {
        return username;
}
public void setUsername(String username) {
        this.username = username;
  public String getPassword(){
    return this.password;
  }
  public void setPassword(String password){
    this.password=password;
  } 
 public ActionErrors validate( ActionMapping mapping, HttpServletRequest request ) {
      ActionErrors errors = new ActionErrors();     
      if( getUsername() == null || getUsername().length() < 5 ) {
        errors.add("username", new ActionMessage("error.username.required"));
      }
      if(getPassword() == null ||getPassword().length() <4 ) {
        errors.add("password",new ActionMessage("error.password.required"));
      }     
      return errors;
  }
    /**
     * Reset all properties to their default values.
     */
  public void reset(ActionMapping mapping, HttpServletRequest request) {
    this.
username =null;
    this.
password =null;
    }
}

What are the important methods of ActionForm?
The important methods of ActionForm are : validate() & reset().

validate() : Used to validate properties after they have been populated; Called before FormBean is handed to Action. Returns a collection of ActionError as ActionErrors. Following is the method signature for the validate() method.
public ActionErrors validate(ActionMapping mapping,HttpServletRequest request)
reset(): reset() method is called by Struts Framework with each request that uses the defined ActionForm. The purpose of this method is to reset all of the ActionForm's data members prior to the new request values being set.
public void reset() {}
What is Struts Validator Framework?
A. Form data can be validated on the client side as well as on the server side using the Validator Framework, which was developed as a third-party add on to Struts. This framework generates the java script and it can be used to validate the form data on the client browser. Server side validation of your form can be carried out by subclassing your form class with DynaValidatorForm class.
The Validator Framework uses two XML configuration files validator-rules.xml and validation.xml. The validator-rules.xml defines the standard validation routines, these are reusable and used in validation.xml to define the form specific validations. The validation.xml defines the validations applied to a form bean.
Client-Side JavaScript Validation
To accomplish this we have to follow the following steps:
Enabling the Validator plug-in: This makes the Validator available to the system.To enable the validator plug-in open the file struts-config.xml and make sure that   following line is present in the file.
  <!--  Validator plugin
 -->
<plug-in className="org.apache.struts.validator.ValidatorPlugIn">
          <set-property   property="pathnames"
           value="/WEB-INF/validator-rules.xml,/WEB-INF/validation.xml"/>
</plug-in>
Create Message Resources:  Message resources are used by the Validator Framework to generate the validation error messages. Open the Struts\strutstutorial\web\WEB-INF\MessageResources.properties file and add the following lines:
logonForm.username =User Name.
logonForm.password =Password.

<form-bean name="LoginForm" type="org.apache.struts.validator.DynaValidatorForm">
   <form-property name="userName" type="java.lang.String" />
 <form-property name="password" type="java.lang.String" />
</form-bean>

Developing the Validation rules We have to define the validation rules in the validation.xml for the address form. Struts Validator Framework uses this rule for generating the JavaScript for validation.
<form-validation>
<formset>
        <form name="logonForm">
            <field property="username" depends="required">
                    <arg key="logonForm.username"/>
            </field>
            <field property="password" depends="required,mask">
                    <arg key="logonForm.password"/>
                    <var>
                        <var-name>mask</var-name>
                        <var-value>^[0-9a-zA-Z]*$</var-value>
                    </var>
            </field>
        </form>
    </formset>
</form-validation>
Applying the rules: We are required to add the appropriate tag to the JSP for generation of JavaScript .
logon.jsp
<%@ taglib  prefix="html" uri="/WEB-INF/struts-html.tld"     %>
<%@ taglib  prefix="bean" uri="/WEB-INF/struts-bean.tld"     %>
<%@ taglib  prefix="logic" uri="/WEB-INF/struts-logic.tld"     %>
<html:html>
<html:errors />

<body>
  <html:form action="/Login" onsubmit="validateLoginForm(this);">
    <html:javascript formName="LoginForm"  dynamicJavascript="true" staticJavascript="true" />
   User Name : <html:text name="LoginForm" property="userName" /><br>
   Password  : <html:password name="LoginForm" property="password" /> <br>
      <html:submit value="Login" />
    </html:form>
</body>
</html>
Note:- The formName property of the javascript tag hold the name of the form specified in the validation.xml file.
Next step is to specify the onsubmit attribute of the HTML Tag Library's form tag. The onsubmit attribute is used to specify the javascript code that should be executed when the form is submitted. If the form name is "loginForm", the generated method name will be "validateLoginForm"

Create the following entry in the struts-config.xml for the mapping the /Login url for handling the form submission through login.jsp.
<action
     path="/
Login"
     type="com.om.LoginAction"
     name="
LoginForm"
     scope="request"
     validate="true"
     input="/pages/login.jsp">
     <forward name="success" path="/pages/success.jsp"/>
</action>
How you will enable front-end validation based on the xml in validation.xml?
The <html:javascript> tag to allow front-end validation based on the xml in validation.xml. For  example the code:
<html:javascript formName="logonForm" dynamicJavascript="true" staticJavascript="true" />
generates the client side java script for the form "logonForm" as defined in the validation.xml file. The <html:javascript> when added in the jsp file generates the client site validation script.
How to validating user input using ActionError class?
1.Override the validate method inside ActionForm which will return a ActionErrors object.
2. Stored the error message in the form of key value pairs in the Resource bundle.
3. Make the validate attribute of action tag inside Struts-config.xml file to true. If it is false then validate method will not be called.
4.Specify the input attribute of action tag inside Struts-config.xml file to the name of the jsp file which will contaion the error messages
5.Use <html:error/> tag inside the jsp page which will capture all the error details.
How you will display validation fail errors on jsp page?
The following tag displays all the errors: <html:errors/>

How the exceptions are handled in struts?
Exceptions in Struts are handled in two ways:
Programmatic exception handling : Explicit try/catch blocks in any code that can throw exception. It works well when custom value (i.e., of variable) needed when error occurs.
 Declarative exception handling :You can either define <global-exceptions> handling tags in your struts-config.xml or define the exception handling tags within <action></action> tag. It works well when custom page needed when error occurs. This approach applies only to exceptions thrown by Actions.
<global-exceptions>
 <exception key="some.key"
            type="java.lang.NullPointerException"
            path="/WEB-INF/errors/null.jsp"/>
</global-exceptions>
or
<exception key="some.key"
           type="package.SomeException"
           path="/WEB-INF/somepage.jsp"/>
How you will make available any Message Resources Definitions file to the Struts Framework Environment?
Message Resources Definitions file are simple .properties files and these files contains the messages that can be used in the struts project. Message Resources Definitions files can be added to the struts-config.xml file through <message-resources /> tag.
Example:-
<message-resources parameter=”MessageResources” />

What are the different kinds of actions in Struts?
The different kinds of actions in Struts are:
Ø  DispatchAction
Ø  LookupDispatchAction
Ø  ForwardAction
Ø  IncludeAction
Ø  SwitchAction

What is DispatchAction?
DispatchAction provides a mechanism for grouping a set of related functions into a single action, thus eliminating the need to create seperate actions for each functions. This class does not provide an implementation of the execute() method as the normal Action class does. The DispatchAction uses the execute method to manage delegating the request to the individual methods based on the incoming request parameter.
Developing an Action Class (Dispatch_Action.java) 
package roseindia.net;
import java.io.*;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.ServletException;
import org.apache.struts.actions.DispatchAction;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
public class Dispatch_Action extends DispatchAction
public ActionForward add(
    ActionMapping mapping,
    ActionForm form,
    HttpServletRequest request,
    HttpServletResponse response) throws Exception{
    System.out.println("You are in add function.");
      return mapping.findForward("add");
  }
public ActionForward edit(
    ActionMapping mapping,
    ActionForm form,
    HttpServletRequest request,
    HttpServletResponse response) throws Exception

 {    System.out.println("You are in edit function.");
            return mapping.findForward("edit");
   }
public ActionForward search(
    ActionMapping mapping,
    ActionForm form,
    HttpServletRequest request,
    HttpServletResponse response) throws Exception{
    System.out.println("You are in search function");
    return mapping.findForward("search");
   }
  public ActionForward save(
    ActionMapping mapping,
    ActionForm form,
    HttpServletRequest request,
    HttpServletResponse response) throws Exception{
    System.out.println("You are in save function");
    return mapping.findForward("save");
 
}
 
}
Developing an ActionForm Class
package roseindia.net;
import org.apache.struts.action.ActionForm;
public class DispatchActionForm extends ActionForm
{
  private String parameter =" ";
  public String getParameter()  
   {
         return parameter;
       }
  public void setParameter(String parameter)
     {
        this.parameter=parameter;
   }
}
Defining form Bean and Action Mapping in struts-config.xml file
<form-bean name="DispatchActionForm"
           type="roseindia.net.DispatchActionForm"/>

<action
path="/DispatchAction"
type="roseindia.net.Dispatch_Action"
parameter="parameter"
input="/pages/DispatchAction.jsp"
name="DispatchActionForm"
scope="request"
validate="false">
<forward name="add" path="/pages/DispatchActionAdd.jsp" />
<forward name="edit" path="/pages/DispatchActionEdit.jsp" />
<forward name="search" path="/pages/DispatchActionSearch.jsp"/>
<forward name="save" path="/pages/DispatchActionSave.jsp" />
</action>
Developing jsp page
DispatchAction.jsp

<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%>
<html:html locale="true">
<HEAD>
<TITLE>Dispatch Action Example</TITLE>
<BODY>
<H3>Dispatch Action Example</H3>
<p><html:link page="/DispatchAction.do?parameter=add">Call Add Section</html:link></p>
<p><html:link page="/DispatchAction.do?parameter=edit">Call Edit Section</html:link></p>
<p><html:link page="/DispatchAction.do?parameter=search">Call Search Section</html:link></p>
<p><html:link page="/DispatchAction.do?parameter=save">Call Save Section</html:link></p>
</html:html>
What is LookupDispatchAction?
Ans: LookupDispatchAction provides a mechanism for grouping a set of related functions into a single action, thus eliminating the need to create seperate actions for each functions. The LookupDispatchAction class extends org.apache.struts.actions. DispatchAction. This class does not provide an implementation of the execute() method as the normal Action class does. The LookupDispatchAction uses the execute method to manage delegating the request to the individual methods based on the incoming request parameter.
LookupDispatchAction  class is much like the DispatchAction class except that it uses a Java Map  and ApplicationResource.properties file to dispatch methods .
package roseindia.net;
import java.io.*;
import java.util.*;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.ServletException;
import org.apache.struts.actions.LookupDispatchAction;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;

public class LookupDispatch_Action extends LookupDispatchAction
{
  protected Map getKeyMethodMap(){
        Map map =  new HashMap();
    map.put("
UserForm.add ","add");
    map.put("
UserForm.edit","edit");
    map.put("
UserForm.search","search");
    map.put("
UserForm.save","save");
    return map;
    }  
  public ActionForward add(
    ActionMapping mapping,
    ActionForm form,
    HttpServletRequest request,
    HttpServletResponse response) throws Exception{
    System.out.println("You are in add function.");
      return mapping.findForward("add");
  }
  public ActionForward edit(
    ActionMapping mapping,
    ActionForm form,
    HttpServletRequest request,
    HttpServletResponse response) throws Exception{
    System.out.println("You are in edit function.");
    return mapping.findForward("edit");
  }
    public ActionForward search(
    ActionMapping mapping,
    ActionForm form,
    HttpServletRequest request,
    HttpServletResponse response) throws Exception{
    System.out.println("You are in search function");
    return mapping.findForward("search");
  }    
  public ActionForward save(
    ActionMapping mapping,
    ActionForm form,
    HttpServletRequest request,
    HttpServletResponse response) throws Exception{
    System.out.println("You are in save function");
    return mapping.findForward("save");
  }
}
Application.properties in the same directory structure where classes are saved.
UserForm.add=Add
UserForm.edit=Edit
UserForm.search=Search
UserForm.save=Save
Add the following, Message Resources Definitions in  struts-config.xml
<message-resources parameter="roseindia.net.ApplicationResources" />
Develop the following Action Mapping in the struts-config.xml
Here, Action mapping helps to select the method from the Action class for specific requests. Note that the value specified with the parameter 
attribute is used to delegate request to the required method of the LookupDispatch_Action Class.
<action path="/LookupDispatchAction" type="roseindia.net.LookupDispatch_Action"
parameter="parameter" input="/pages/LookupDispatchAction.jsp" name="LookupDispatchActionForm" scope="request" validate="false">
<forward name="add" path="/pages/LookupDispatchActionAdd.jsp" />
<forward name="edit" path="/pages/LookupDispatchActionEdit.jsp" />
<forward name="search" path="/pages/LookupDispatchActionSearch.jsp"/>
<forward name="save" path="/pages/LookupDispatchActionSave.jsp" />
</action>
Developing jsp page
Code of the jsp (LookupDispatchAction.jsp) to delegate requests to different jsp pages:
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%>
<html:html locale="true">
<HEAD>
<TITLE>Dispatch Action Example</TITLE>
<BODY>
<H3>Dispatch Action Example</H3>
<p><html:link page="/LookupDispatchAction.do?parameter=add">Call Add Section</html:link></p>
<p><html:link page="/LookupDispatchAction.do?parameter=edit">Call Edit Section</html:link></p>
<p><html:link page="/LookupDispatchAction.do?parameter=search">Call Search Section</html:link></p>
<p><html:link page="/LookupDispatchAction.do?parameter=save">Call Save Section</html:link></p>
</html:html>
What is the use of ForwardAction?
The org.apache.struts.actions.ForwardAction class enables a user to forward request to the specified URL. ForwardAction is an utility classs that is used in cases where a user simply needs to forward the control to an another JSP page. Linking directly a JSP to another violates the MVC principles.  So we achieve this through  action-mapping. Note that we do not  create any action class. With ForwardAction, simply create an action mapping in the Strut Configuration and specify the location where the action will forward the request. No need to develop an Action Class.Developing the Action Mapping in the struts-config.xml
Create seperate action-mapping, for each page you want to link. Note that the "type" attributes always take "org.apache.struts.actions.ForwardAction" value. Here”parameter" attribute specifies the URL to which the request is forwarded .
<action
path="/success"
type="org.apache.struts.actions.ForwardAction"
parameter="/pages/Success.jsp"

input="/pages/ForwardAction.jsp"
scope="request"
validate="false">
</action>
Developing a jsp page

Code of the jsp (ForwardAction.jsp)  to forward request to a different jsp page :
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%>
<html:html locale="true">
<HEAD>
<TITLE>Forward Action Example</TITLE>
<BODY>

<H3>Forward Action Example</H3>
<p><html:link page="/success.do">Call the Success page</html:link></p>
</html:html>
Add the following line in the index.jsp to call the form.
<li>
<html:link page="/pages/ForwardAction.jsp">Struts Forward Action</html:link>
<br>
Example shows you how to use forward class to forward request to another JSP page.
</li>

Open the browser and navigate to the ForwardAction.jsp page.
What is IncludeAction?
The IncludeAction class is useful when you want to integrate Struts into an application that uses Servlets. Use the IncludeAction class to include another resource in the response to the request being processed.
What is SwitchAction?
The SwitchAction class provides a means to switch from a resource in one module to another resource in a different module. SwitchAction is useful only if you have multiple modules in your Struts application. The SwitchAction class can be used as is, without extending.


What is Struts DynaActionForm?
DynaActionForm is specialized subclass of ActionForm that allows the creation of form beans with dynamic sets of properties, without requiring the developer to create a Java class for each type of form bean. DynaActionForm eliminates the need of FormBean class and now the form bean definition can be written into the struts-config.xml file. So, it makes the FormBean declarative and this helps the programmer to reduce the development time.
Using a DynaActionForm instead of a custom subclass of ActionForm is relatively straightforward. You need to make changes in two places:
àIn struts-config.xml: change your <form-bean> to be an org.apache.struts.action.DynaActionForm instead of some subclass of ActionForm
<form-bean name= " DynaLoginForm " type="org.apache.struts.action.DynaActionForm" >
    <form-property name="userName" type="java.lang.String"/>
    <form-property name="password" type="java.lang.String" />
</form-bean>
àIn your Action subclass that uses your form bean:
  1. import org.apache.struts.action.DynaActionForm
  2. downcast the ActionForm parameter in execute() to a DynaActionForm
  3. access the form fields with get(field) rather than getField()



import org.apache.struts.action.DynaActionForm;
public class LoginAction extends org.apache.struts.action.Action {
public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response)throws Exception {
DynaLoginForm loginForm = (DynaLoginForm) form;
ActionMessages errors = new ActionMessages();       
        if (((String) loginForm.get("userName")).equals("")) {
            errors.add("userName", new ActionMessage(
                            "error.userName.required"));
        }
        if (((String) loginForm.get("password")).equals("")) {
            errors.add("password", new ActionMessage(
                            "error.password.required"));
        }

String userName = loginForm.get("userName").toString();
String password = loginForm.get("password").toString();
if(userName.equals(password))
{
return mapping.findForward("success");
}
else
{
return mapping.findForward("failure");
}
}
}
<action path="/DynaLogin" type="roseindia.net.LoginAction"
     name="
DynaLoginForm”
     scope="request"
     validate="true"
     input="/pages/DynaLogin.jsp">
Struts Tag Library
The Struts framework provides a fairly rich set of framework components. It also includes a set of tag libraries that are designed to interact intimately with the rest o the framework. The customg tags provided by Struts framework are grouped into four distinct libraries
1. HTML
2. Bean
3. Logic
4. Template

And a special library called Nested tag library.
Custom tags with in Struts HTML tag library
base
- renders an HTML base element
button
- renders a button input fiels
cancel
- renders a cancel button
checkbox
- renders a checkbox input field
errors
- conditionnaly renders a set of accumulated error messages
file
- renders a file select input field
form
- defines an HTML form element
frame
- renders an HTML frame element
hidden
- renders a hidden field
html
- renders an HTMl html element
image
- renders an input tag of type "image"
img
- renders an HTMl img tag
javascript
- renderts JavaScript validation rules loaded by ValidationPlugin
link
- renders an HTML anchoror hyperlink
messages
- Conditionally displays a set of accumulated messages
multibox
-renders multiple checkbox input fields
option
- renders a select option
options
- renders a collection of select options
options Collection
- render a collection of select options
password
-renders apassword input field
radio
-renders a radio button input field
reset
-renders a rest button input field
rewrite
- renders a URI
select
-renders a select element
submit
-renders a submi button
text
-renders an input field of type "text"
textarea
-renders an textarea input field