Add the following code snippet into the struts.xml file.
struts.xml
<action name="actionTag" class="struts.actionTag"> <result name="success">/pages/genericTags/success.jsp</result> </action>
Create an action class as shown below:
actionTag.java
package net.roseindia; import com.opensymphony.xwork2.ActionSupport; public class actionTag extends ActionSupport { public String execute() throws Exception{ return SUCCESS; } }
Now create a jsp page using
success.jsp
<%@ taglib prefix="s" uri="/struts-tags" %> <html> <head> <title>Action Tag Example!</title> </head> <body> <h1><span style="background-color: #FFFFcc">Action Tag (Data Tags) Example!</span></h1> <s:action name="success"> <b><i>The action tag will execute the result and include it in this page.</i></b></div> </s:action> </body> </html>
Output of the success.jsp