title: construct a dynamic url using path variables in spring controller
body: <p>i would like to generate a dynamic url like 
  <a href="http://example.com/path/to/page?name=ferret&amp;color=purple" rel="nofollow noreferrer">http://example.com/path/to/page?name=ferret&amp;color=purple</a> </p>
  
  <p>where i can send name and color two separate input fields from my form to controller as a single parameter.
  can someone please help me with the corresponding jsp and spring controller coding.</p>
  
  <p>the following is my controller :</p>
  
  <pre><code>@RequestMapping(value = "/ws/jobs/{title}/{location}/{experience}")
       public ModelAndView openRequirementsRedirect(JobSearchRequest jobSearchRequest) throws Exception{
       ModelAndView model = new ModelAndView();
           model.addObject("title", jobSearchRequest.getTitle());
       model.addObject("location", jobSearchRequest.getLocation());
       model.addObject("experience", jobSearchRequest.getExperience());
       model.setViewName("openJobs/openjobs");
       return model;
  }
  </code></pre>
  
  <p>i am having pojo :</p>
  
  <pre><code>public class JobSearchRequest {
      private String title;
      private String location;
      private String experience;
      public String getTitle() {
          return title;
      }
      public void setTitle(String title) {
          this.title = title;
      }
      public String getLocation() {
          return location;
      }
      public void setLocation(String location) {
          this.location = location;
      }
      public String getExperience() {
          return experience;
      }
      public void setExperience(String experience) {
          this.experience = experience;
      }
  }
  </code></pre>
  
  <p>and  y jsp call is something like this :</p>
  
  <pre><code>window.location.href = example+"/abc?&amp;title="+title+"&amp;location="+location+"&amp;experience="+experience;
  </code></pre>