In this section, we are going to describe the Bean Tag. The Bean tag is a generic tag that is used to instantiates a class that confirms to the JavaBeans specification. This tag has a body which can contain a number of Param elements to set any mutator methods on that class. If the id attribute is set on the BeanTag, it will place the instantiated bean into the stack's Context. Add the following code snippet into the struts.xml file. struts.xml <action name="beanTag" class="struts2.actionTag"> <result name="success">/pages/genericTags/bean.jsp</result> </action> Create an action class as shown below: beanTag.java package net.struts2; import com.opensymphony.xwork2.ActionSupport; public class beanTag extends ActionSupport { public String execute() throws Exception{ return SUCCESS; } }...
Archive of Struts 2 examples with tag, script. This is the best tutorial of struts 2 framework.