title: Using s:url in s:a in struts2
body: <p>I'm trying to generate a link for each string in my List of strings.  This link will call an action and pass in a parameter (a getStudentById action passing in the studentId).  I've tried a couple of ways to get this to work by searching on the interwebs, however, have not had any luck.  The most recent try results in each link having a url of "www.com" which I have no clue where that comes from.  Below are a couple of files for consideration in trying to help me figure out what's going wrong.</p>
  
  <p>WinnerAcknowledgement.jsp</p>
  
  <pre class="lang-jsp prettyprint-override"><code>&lt;!DOCTYPE html&gt;
  &lt;%@ taglib prefix="s" uri="/struts-tags" %&gt;
  &lt;html&gt;
      &lt;head&gt;
          &lt;link rel="stylesheet" href="${pageContext.request.contextPath}/js/jquery/jquery-ui-1.11.4/jquery-ui.css" type="text/css" media="all"/&gt;
          &lt;link rel="stylesheet" href="${pageContext.request.contextPath}/js/jquery/jquery-ui-1.11.4/jquery-ui.theme.css" type="text/css" media="all"/&gt;
          &lt;link rel="stylesheet" href="${pageContext.request.contextPath}/css/bootstrap/bootstrap-datepicker.css" type="text/css" /&gt;
          &lt;link rel="stylesheet" href="${pageContext.request.contextPath}/css/survey_bh.css" type="text/css" /&gt;
          &lt;link rel="stylesheet" href="${pageContext.request.contextPath}/css/style_bh.css" type="text/css" /&gt;
      &lt;/head&gt;
      &lt;body&gt;
          &lt;a href='index.jsp'&gt;Home&lt;/a&gt;
          &lt;p&gt;Survey saved!&lt;/p&gt;
          &lt;p&gt;Congratulations!  You're the winner of the raffle and have just won two movie tickets.&lt;/p&gt;
          &lt;div&gt;
              &lt;s:set var="mean" value="db.mean"/&gt;
              &lt;s:set var="standardDeviation" value="db.standardDeviation"/&gt;
              &lt;p&gt;&lt;span&gt;&lt;strong&gt;Mean:&lt;/strong&gt;&lt;/span&gt;&amp;nbsp;&amp;nbsp;&lt;span&gt;&lt;s:number name="%{mean}" type="number" /&gt;&lt;/span&gt;&lt;/p&gt;
              &lt;p&gt;&lt;span&gt;&lt;strong&gt;Standard Deviation:&lt;/strong&gt;&lt;/span&gt;&amp;nbsp;&amp;nbsp;&lt;span&gt;&lt;s:number name="%{standardDeviation}" type="number" /&gt;&lt;/span&gt;&lt;/p&gt;
          &lt;/div&gt;
          &lt;div&gt;
              &lt;p&gt;Students:&lt;/p&gt;
              &lt;ul&gt;
                  &lt;s:iterator value="studentIds" status="status"&gt;
                      &lt;s:url action="getStudentById" includeParams="get" var="url"&gt;
                          &lt;s:param name="studentId"&gt;&lt;s:property/&gt;&lt;/s:param&gt;
                      &lt;/s:url&gt;
                      &lt;li&gt;
                          &lt;s:a href="%{url}"&gt;&lt;s:property/&gt;&lt;/s:a&gt;
                      &lt;/li&gt;
                  &lt;/s:iterator&gt;
              &lt;/ul&gt;   
          &lt;/div&gt;
      &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>struts.xml</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;!--?xml version="1.0" encoding="UTF-8" ?--&gt;
  &lt;!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN" "http://struts.apache.org/dtds/struts-2.0.dtd"&gt;
  &lt;struts&gt;
    &lt;constant name="struts.enable.DynamicMethodInvocation" value="false"&gt;&lt;/constant&gt;
    &lt;constant name="struts.devMode" value="false"&gt;&lt;/constant&gt;
    &lt;constant name="struts.custom.i18n.resources" value="ApplicationResources"&gt;&lt;/constant&gt;
  
    &lt;package name="default" extends="struts-default" namespace="/"&gt;
      &lt;action name="getStudentById" class="com.action.SurveyAction" method="getStudentById"&gt;
        &lt;result name="success"&gt;Student.jsp&lt;/result&gt;
        &lt;result name="error"&gt;NoSuchStudent.jsp&lt;/result&gt;
      &lt;/action&gt;
      &lt;action name="saveSurvey" class="com.action.SurveyAction" method="saveSurvey"&gt;
        &lt;result name="simple"&gt;SimpleAcknowledgement.jsp&lt;/result&gt;
        &lt;result name="winner"&gt;WinnerAcknowledgement.jsp&lt;/result&gt;
        &lt;result name="error"&gt;error.jsp&lt;/result&gt;
      &lt;/action&gt;
    &lt;/package&gt;
  &lt;/struts&gt;
  </code></pre>