title: Spring Mvc Request forwarding
body: <pre><code>@RequestMapping("/modify")
  public String modifyAd(AdDto adDto, Model model){
      if (adService.modifyAd(adDto)){
          adDto.setTitle("");
          model.addAttribute(PageCodeEnum.KEY,PageCodeEnum.MODIFY_SUCCESS);
      }else {
          model.addAttribute(PageCodeEnum.KEY,PageCodeEnum.MODEFY_FAILED);
      }
      return "forward:search";
  }
  </code></pre>
  
  <p>The adDto.title I got from jsp is '芒果冰淇淋11',</p>
  
  <p>I have set Title to ""</p>
  
  <p><img src="https://i.stack.imgur.com/6gX22.png" alt="debug before forward"></p>
  
  <pre><code>@RequestMapping(value = "/search",method = RequestMethod.POST)
  public String queryByTitle(AdDto adDto, Model model){
      List&lt;Ad&gt;adList = adService.queryByTitle(adDto);
      model.addAttribute("adList",adList);
      model.addAttribute("searchParam",adDto);
      return "/content/adList";
  }
  </code></pre>
  
  <p>But after forward, <code>adDto.title</code> doesn's change. I don't know why.</p>
  
  <p><img src="https://i.stack.imgur.com/D7z2b.png" alt="debug after forward"></p>
  
  <p>You can see the 'title' change to "芒果冰淇淋11"</p>