Skip to main content

Posts

Showing posts with the label Property Tag

Struts2 - Property Tag (Data Tags)

In this section, we are going to describe the property tag. The property tag is a generic tag that is used to get the property of a value, which will default to the top of the stack if none is specified. Add the following code snippet into the struts.xml file. struts.xml <action name="propertyTag" class="net.struts2.propertyTag">   <result>/pages/genericTags/propertyTag.jsp</result> </action> Create an action class as shown: propertyTag.java package net.struts2; import com.opensymphony.xwork2.ActionSupport; public class propertyTag extends ActionSupport {   public String execute() throws Exception{   return SUCCESS;   } } Create a bean class " companyName " as shown: companyName.java package net.struts2; public class companyName {      private String name;   public voi...