title: Passing values within JSP using Spring-MVC
body: <p>I am working on a Spring-MVC application. I am implementing the password reset functionality. I already can send emails, and have a password reset page. The user should just enter the password, the token will be checked and password reset. I am making some mistake calling the link.. I get apache error that syntax was incorrect. What am I doing wrong.</p>
  
  <p>Link called for password change :</p>
  
  <pre><code>localhost:8085/newpassword/usernameAndDateToken
  </code></pre>
  
  <p>Controller :</p>
  
  <pre><code>@RequestMapping(value = "/resetpassword")
      public String newPasswordPage(Model model){
          model.addAttribute("person", new Person());
          return "resetpassword";
      }
  
      @RequestMapping(value = "/newpassword")
      public String changePasswordFunction(@ModelAttribute("person") Person person,@RequestParam("username")String username,Model model){
          personService.changePassword(username,person.getPassword());
          model.addAttribute("person",person);
          return "redirect:/";
      }
  </code></pre>
  
  <p>resetpassword.jsp :</p>
  
  <pre><code>&lt;%@ page contentType="text/html;charset=UTF-8" language="java" %&gt;
  &lt;html&gt;
  &lt;head&gt;
      &lt;title&gt;&lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;
  
  &lt;c:url var="addAction" value="/newpassword" &gt;&lt;/c:url&gt;
  &lt;form:form action="${addAction}" commandName="person"&gt;
      &lt;table&gt;
          &lt;tr&gt;
              &lt;td&gt;
                  &lt;form:label path="password"&gt;
                      &lt;spring:message text="password"/&gt;
                  &lt;/form:label&gt;
              &lt;/td&gt;
              &lt;td&gt;
                  &lt;form:input path="password"  /&gt;
              &lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;
                  &lt;input name="submit" type="submit" value="Submit" /&gt;
              &lt;/td&gt;
          &lt;/tr&gt;
      &lt;/table&gt;
  &lt;/form:form&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>