Latest Tutorials| Questions and Answers|Ask Questions?|Site Map

Home Struts Struts2 Struts2uitags Checkbox Tag (Form Tag) Example

Related Tutorials


Share on Google+Share on Google+

Checkbox Tag (Form Tag) Example

In this section, we are going to describe the checkbox tag .

Checkbox Tag (Form Tag) Example


In this section, we are going to describe the checkbox tag. The checkbox tag is a UI tag that is used to render an HTML input element of type checkbox, populated by the specified property from the ValueStack. 

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

<action name="checkboxTag">

Create a jsp using the tag <s:checkbox> It renders an HTML input element of type chechbox.

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

  <title>Checkbox  (Form TagTag Example!</title>
  <h1><span style="background-color: #FFFFcc">
Checkbox Tag Example!</span></h1>

  <s:checkbox label="Male" name="male" value="true" /><br>
  <s:checkbox label="Female" name="male" />


Output of the checkboxTag.jsp :


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: July 28, 2007

Related Tutorials

Discuss: Checkbox Tag (Form Tag) Example   View All Comments

Post your Comment

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