title: Optional parameters in thymeleaf url
body: <p>I am generating a url in thymeleaf using the following code. </p>
  
  <pre><code>@{/schedule/data/bookableTimes/{teacherUsername}(teacherUsername=${teacher.user.username},lessonLengthType=${lessonLengthType},studentId=${#httpServletRequest.getParameter('studentId')})}
  </code></pre>
  
  <p>This works perfectly, when the studentId is supplied. However I also want to cater for the scenario when the studentId is not supplied.
  Currently if the studentId is not supplied it will generate a url like so</p>
  
  <pre><code>/schedule/data/bookableTimes/teacher?lessonLengthType=full&amp;studentId=
  </code></pre>
  
  <p>However this is not what I want, in the case that the studentId is null, I'd rather not have the studentId portion of the url generated at all. Is there a simple way to do this using thymeleaf?</p>