Home Struts Struts2 Subset Tag

Related Tutorials


 
 

Share on Google+Share on Google+

Subset Tag

Advertisement
In this tutorial you will learn about the struts tags

Subset Tag (Control Tags) Example Using Start

In this section, you will learn how to set the tool tip text for text field tag of struts2. Tool Tip text is the help text of any component for user. When you rest the mouse cursor on the component then at that point a message. Which show the information about that component.

Add the following code snippet into the struts.xml file.

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE struts PUBLIC
  "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
  "http://struts.apache.org/dtds/struts-2.0.dtd">

<struts>
  <!-- Rose India Struts Tutorials -->
  <constant name="struts.enable.DynamicMethodInvocation" value="false" />
  <constant name="struts.devMode" value="true" />

  <package name="roseindia" namespace="/roseindia" 
 extends
="struts-default">

  <action name="Tooltips">
  <result>/pages/uiTags/toolTips.jsp</result>
  </action>

 <!-- Add actions here -->
  </package>


  <!-- Add packages here -->

</struts>

Now we create a jsp page using <s:form> and <s:textfield> tags as shown in the toolTips.jsp page. 

toolTips.jsp

<%taglib prefix="s" uri="/struts-tags" %>

<html>
  <head> 
  <title>Combobox (Form TagTag Example!</title>
  <link href="<s:url value="/css/main.css"/>" rel="stylesheet"
  type="text/css"/>
  </head>
  <body>
  <h1><span style="background-color: #FFFFcc">Tooltips Example!</span></h1>
  <s:form>
  <s:textfield name="name" label="Enter Name" 
size=
"20" tooltip="Please Enter name"/>
  <s:param name="tooltipDelay" value="200" />
  </s:form>
  </body>
</html>

Output of toolTips:

Advertisements

If you enjoyed this post then why not add us on Google+? Add us to your Circles



Liked it!  Share this Tutorial


Follow us on Twitter, or add us on Facebook or Google Plus to keep you updated with the recent trends of Java and other open source platforms.

Posted on: April 18, 2011

Related Tutorials

Discuss: Subset Tag  

Post your Comment


Your Name (*) :
Your Email :
Subject (*):
Your Comment (*):
  Reload Image
 
 
Comments:0
DMCA.com