我尝试了this和this,但我遇到了同样的问题。 登录后,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";
}
}
}
如何更改我的网址?