Spring MVC: Url path appending when posting the form

前端 未结 4 926
情深已故
情深已故 2020-12-24 00:45

i am new to spring mvc. i created a simple login application. but in my case the first time the for posting url and calling controller method correctly. in second time it\'s

4条回答
  •  渐次进展
    2020-12-24 01:05

    Depending on which version of Spring you're using, here are some options:

    Spring 3.1 and lower OR Spring 3.2.3 and higher

    You should have your urls/actions root-relative specific to your context path.

    
    

    Note: Spring 3.2.3 introduced servletRelativeAction but I've never used it.

    Spring 3.2

    Don't do anything, context path is prepended - this was actually a breaking change and eventually rolled back.

     
    //will produce action="/springmvc/account/login"
    

提交回复
热议问题