Spring URL Path不会改变

时间:2013-01-16 02:18:33

标签: redirect spring-mvc

我尝试了thisthis,但我遇到了同样的问题。 登录后,URL未更改。 这是我的代码:

@RequestMapping(value="/login", method = RequestMethod.POST)
public String processLogin(@ModelAttribute("login") Login login,BindingResult result, SessionStatus status) throws ServiceException, RemoteException{
    loginValidator.validate(login, result);
if (result.hasErrors()) {
        //if validator failed
        return "login";
    } else {
        status.setComplete();
        AdministrationServiceResponse rs = null;
        AdministrationServiceRequest rsr = new AdministrationServiceRequest();
        AdministrationServiceService ts = new AdministrationServiceServiceLocator(Config.HOST, Config.PORT, Config.LOCATION, false);
        AdministrationServiceSoapBindingStub rssbs = (AdministrationServiceSoapBindingStub) ts.getAdministrationService();

        rsr.setLoginId(Config.USERNAME);
        rsr.setPassword(Config.PASSWORD);
        rsr.setOrgId(new Integer(1));
        rsr.setFunction("VALIDATEUSER");

        AdministrationPerson ap = new AdministrationPerson();
        ap.setUserId(login.getUsername());
        ap.setPassword(login.getPassword());
        rsr.setPerson(ap);
        rs = rssbs.remoteAdministrationCall(rsr);
        if ("SUCCESS".equals(rs.getStatusCode()) ) {
            return "redirect:/WebBI/report";
        } else {
            return  "login";
        }
    }
}

如何更改我的网址?

0 个答案:

没有答案