开发者

spring form processing - redirecting success view

In my spring application , Am doing form processing using SimpleFormController. Does any one know , how to redirect the successView to another resource (URI) ..?

below is my configuration ,

<bean name="/one.htm" class="aaaaa.Bbbbbbbbb" >

    `<property name="commandClass" value="abc.Def"/>`
    `<property name="formView" value="one"/>`
    `<property name="successView" value="two.htm"/>`
    `<property name="validator" ref="loginValidator"/>`

</bean>

<bean name="/two.htm" class="xxxx.yyyy.Zzzzz" />

<bean id="viewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver">

    `<property name="viewClass" value="org.springframework.web.servlet.view.JstlView"/>`
    `<property name="prefix" value="/"/>`
    `<property name="suffix" value=".jsp"/>`

</bean>

I开发者_开发百科 want , the success view should go to /two.htm . but it searches /two.jsp . What could be the reason for this ?


Use redirect: prefix:

<property name="successView" value="redirect:/two.htm"/>

See also:

  • 15.5.3.2 The redirect: prefix
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜