spring 三 mvc form:form 标签自动生成

spring 3 mvc form:form 标签自动生成
我在我机器上 运行下了spring3mvc petclinic 例子

spring 自带的sample 提交表单action 里的url 是不会自动加上

类似 这里的 jsessionid=F5828A85A4F098E69529A15123A32B2D


我在我机器上 写了个表单提交页面  打开后 页面后

<form id="user" action="/@Spring3/user/new;jsessionid=F5828A85A4F098E69529A15123A32B2D" method="post">
  <table>
    <tr>
      <th>
        User Name:
        <br/>
        <input name="username" size="30" maxlength="80"/>
      </th>
    </tr>
    <tr>
      <td>
           <p class="submit"><input type="submit" value="Add Owner"/></p>
      </td>
    </tr>
  </table>
</form>

会自动加上 jsessionid   但是 Spring 3 提供的sample 确不会

这是为什么,网上查了下 还是没解决问题

有谁知道吗?
1 楼 solecjj 2010-07-05  
This is a feature of org.springframework.web.servlet.veiw.RedirectView class, you can check the method urlEncode for details.

To fix the issue below are the options:

1. Change the source code and build your own version of RedirectView class.

2. Write a class to extend RedirectView , here is a reference http://dpaste.com/214689/ and change your configuration to use the customized redirect view.

3. Use spring-security api , configure disable-url-rewriting="true" in the <http> namespace, then jseesionid will be gone.

I have tried option 3 with 3.0.0.RELEASE version and it works.spring 三 mvc form:form 标签自动生成

For Spring Security 3 this https://src.springframework.org/svn/spring-security/tags/spring-security-3.0.0.RELEASE/samples/tutorial/ can be a ref.

Originally this is a bug : https://jira.springsource.org/browse/SEC-1052?page=com.atlassian.jira.plugin.system.issuetabpanels%3Aall-tabpanel.