<form:form action =“”in =“”spring =“”

时间:2015-10-15 12:11:26

标签: java spring spring-mvc

=“”

我在网上有一个欢迎页面的弹簧应用程序.XML

<welcome-file-list>
   <welcome-file>/search/search.do</welcome-file>
</welcome-file-list>

和这个控制器

@Controller
public class SearchController {

    @RequestMapping(value = "/search/search.do", method = RequestMethod.GET)
    private String initForm(@ModelAttribute("searchForm") final SearchForm SearchForm, 
                             BindingResult result, HttpServletRequest request, Model model, Locale locale) {

        sessionHelper.checkSessionAttributes(request,  locale);
        return "searchView";
    }


    @RequestMapping(value = "/search/performDevicesearch.do", method = RequestMethod.POST)
    private String performDeviceSearch(@ModelAttribute("searchForm") final SearchForm SearchForm, 
                             BindingResult result, HttpServletRequest request, Model model, Locale locale) {

        sessionHelper.checkSessionAttributes(request,  locale);
        return "searchView";
    }           
}

和这个JSP

<form:form commandName="searchForm" name="simpleSearchForm" id="simpleSearchForm"  method="post" action="search/performproductsearch.do" class="TTWForm1"   >

所以我把它放在网址

http://127.0.0.1:7001/devices

然后我提交,我在网址

中看到了这一点

http://127.0.0.1:7001/devices/search/performproductsearch.do

然后我再次提交,但我在网址(!?)

中看到了这一点
http://127.0.0.1:7001/devices/search/search/performproductsearch.do

0 个答案:

没有答案