title: Getting value of JSP data in the controller
body: <p>I have a table which displays a target group list. A link is there to view each target group. When I click on "view" it goes to the controller where I want to print the particular target group.</p>
  
  <p>How do I pass that particular target group from the target group list in the controller?</p>
  
  <p>This is my JSP:</p>
  
  <pre><code>&lt;%@ page isELIgnored="false"%&gt; 
      &lt;%@ taglib uri="http://www.springframework.org/tags/form" prefix="form"%&gt; 
      &lt;%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%&gt;
      &lt;html&gt;
      &lt;head&gt;
      &lt;meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"&gt;
      &lt;title&gt; viewTargetGroupList&lt;/title&gt;
      &lt;/head&gt;
      &lt;body&gt;
      &lt;%@include file="content.jsp" %&gt;
  
       &lt;form:form commandName="targetGroupList" method="post" action="/segmentation-of-customers/viewOneTargetGroup"&gt;
          &lt;c:if test = "${not empty targetGroupList }"&gt;
          &lt;table border="1"&gt;
                  &lt;tr&gt;
                      &lt;th&gt;TARGET GROUP ID&lt;/th&gt;
                       &lt;th&gt;TARGET GROUP NAME&lt;/th&gt;  
                       &lt;th&gt;VIEW&lt;/th&gt;
                  &lt;/tr&gt;
                  &lt;c:forEach items="${targetGroupList}" var="targetGroupList"&gt;
                      &lt;tr&gt;
                          &lt;td&gt; ${targetGroupList.targetGroupId}&lt;/td&gt;
                           &lt;td&gt; ${targetGroupList.targetGroupName}&lt;/td&gt;   
            &lt;a href="/segmentation-of-customers/viewOneTargetGroup"&gt; View&lt;/a&gt;
      &lt;/tr&gt;
                  &lt;/c:forEach&gt;
  
              &lt;/table&gt;
          &lt;/c:if&gt;
          &lt;input type="submit" name="Submit" value="VIEW TARGET GROUP"&gt;&lt;/input&gt;
      &lt;/form:form&gt;
  
      &lt;/body&gt;
      &lt;/html&gt;
  </code></pre>