Sending a parameter from List to a method which is annotated with @ModelAttribute
<p>I have a list page as shown below and when I click on Edit button, I want to send the patientId to the getObject() so that I can load the object from DB if the patientId exists. I tried in many ways, but its taking null as the patiendId in getObject(). 
Any suggestions would be appreciated. </p>

<p>Following is my List page ::</p>

<pre><code>       &lt;c:forEach var="pat" items="${patients}" varStatus="status"&gt;
            &lt;tr&gt;                            
            &lt;c:url var="editUrl" value="/patient/${pat.patientId}"/&gt;

                    &lt;td&gt;${pat.firstName}&lt;/td&gt;
                    &lt;td&gt;${pat.mobileNumber1}&lt;/td&gt;
                    &lt;td&gt;${pat.emailId1}&lt;/td&gt;

               &lt;td&gt;&lt;a href='&lt;c:out value="${editUrl}"/&gt;'&gt;Edit&lt;/a&gt;&lt;/td&gt;

        &lt;/tr&gt;
    &lt;/c:forEach&gt;
</code></pre>

<p>Controller code::</p>

<pre><code>@Controller
@RequestMapping(value="/patient")
public class PatientController {

  @ModelAttribute
  public Patient getObject(@RequestParam(required=false) String patientId){

    System.out.println("Model Attribute method :: "+patientId);
    //Here I want to load the object using patientId.
    return(patientId != null ? patientDAO.findPatientById(patientId) : new    Patient());

}

@RequestMapping(value="/{patientId}", method=RequestMethod.GET)
public String editPatient(@PathVariable("patientId")String  patientId){
    System.out.println("Editing Id : "+patientId);
    //Able to get the Id here.
    return "editPage";
</code></pre>

<p>}</p>