Home Struts Struts2 Struts2uitags Textarea Tag (Form Tag) Example
Questions:Ask|Latest



Textarea Tag (Form Tag) Example
Posted on: July 28, 2007 By Deepak Kumar
In this section, we are going to describe the textarea tag.

Textarea Tag (Form Tag) Example

     

In this section, we are going to describe the textarea tag. The textarea tag is a UI tag that is used to render an HTML textarea. 

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

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

Create a jsp using the tag <s:textarea > that renders an HTML textarea tag.

<s:textarea label="Description" name="description" cols="15" rows="10" /> tag displays an HTML textarea with label equal to Description, column value=15 and row value=10.
textareaTag.jsp

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

<html>
  <head>
  <title>Textarea Tag Example</title>
  <link href="<s:url value="/css/main.css"/>" rel="stylesheet"
  type="text/css"/> 
  </head>
  <body>
  <h1><span style="background-color: #FFFFcc">Textarea Tag Example!</span></h1>
  <s:form>
  <s:textarea label="Description" name="description" cols="15" rows="10" />
  </s:form>
  </body>
</html>

Output of the textareaTag.jsp:


Recommend the tutorial

Ask Questions?    Discuss: Textarea Tag (Form Tag) Example   View All Comments

Post your Comment


Your Name (*) :
Your Email :
Subject (*):
Your Comment (*):
  Reload Image
 
 
Comments