本文整理汇总了Java中org.springframework.web.bind.support.SessionStatus.setComplete方法的典型用法代码示例。如果您正苦于以下问题:Java SessionStatus.setComplete方法的具体用法?Java SessionStatus.setComplete怎么用?Java SessionStatus.setComplete使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.springframework.web.bind.support.SessionStatus
的用法示例。
在下文中一共展示了SessionStatus.setComplete方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: logonMethod
import org.springframework.web.bind.support.SessionStatus; //导入方法依赖的package包/类
@RequestMapping(value = "/logon.sf", method = RequestMethod.POST)
public String logonMethod(
@ModelAttribute("logon") Logon logon,
BindingResult result, SessionStatus status) {
logonValidator.validate(logon, result);
if (result.hasErrors()) {
//if validator failed
return "login";
} else {
status.setComplete();
//form success
return "securepage";
}
}
示例2: deleteProfileImage
import org.springframework.web.bind.support.SessionStatus; //导入方法依赖的package包/类
@RequestMapping(value = "/users/upload", params = {"deleteImage"}, method = RequestMethod.POST)
public String deleteProfileImage(CurrentUser currentUser, RedirectAttributes attributes,
Model model, SessionStatus status) {
logger.info("Removing Profile Image for user: {}", currentUser.getUser().getUsername());
String profileRedirectUrl = String.format("redirect:/%s", currentUser.getUsername());
ProfileImageDTO profileImageDTO = new ProfileImageDTO();
model.addAttribute("profileImageDTO", profileImageDTO);
userService.updateHasAvatar(currentUser.getId(), false);
status.setComplete();
webUI.addFeedbackMessage(attributes, FEEDBACK_MESSAGE_KEY_PROFILE_IMAGE_REMOVED);
return profileRedirectUrl;
}
示例3: handleFileUpload
import org.springframework.web.bind.support.SessionStatus; //导入方法依赖的package包/类
@RequestMapping(value = "/users/upload", method = RequestMethod.POST)
public String handleFileUpload(@Valid ProfileImageDTO profileImageDTO,
BindingResult result, ModelMap model, CurrentUser currentUser,
RedirectAttributes attributes, SessionStatus status) throws IOException {
String profileRedirectUrl = String.format("redirect:/user/%s?ico", currentUser.getUsername());
if (result.hasErrors()) {
logger.info("Profile Image Errors for: {}", profileImageDTO.getFile().getOriginalFilename());
return USER_PROFILE_VIEW;
} else {
logger.debug("Fetching file");
MultipartFile multipartFile = profileImageDTO.getFile();
String userKey = currentUser.getUser().getUserKey();
webUI.processProfileImage(profileImageDTO, userKey);
userService.updateHasAvatar(currentUser.getId(), true);
status.setComplete();
webUI.addFeedbackMessage(attributes, FEEDBACK_MESSAGE_KEY_PROFILE_IMAGE_UPDATED);
return profileRedirectUrl;
}
}
示例4: addUser
import org.springframework.web.bind.support.SessionStatus; //导入方法依赖的package包/类
@RequestMapping(value = "/users/new", method = RequestMethod.POST)
public String addUser(@Valid UserDTO userDTO,
BindingResult result, SessionStatus status, Model model,
RedirectAttributes attributes) {
if (result.hasErrors()) {
model.addAttribute("authorities", userService.getRoles());
return ADMIN_USERFORM_VIEW;
} else {
userDTO.setSignInProvider(SignInProvider.SITE);
User added = userService.create(userDTO);
logger.info("Added user with information: {}", added);
status.setComplete();
webUI.addFeedbackMessage(attributes, FEEDBACK_MESSAGE_KEY_USER_ADDED, added.getFirstName(),
added.getLastName());
return "redirect:/admin/users";
}
}
示例5: addTag
import org.springframework.web.bind.support.SessionStatus; //导入方法依赖的package包/类
@RequestMapping(value = "/tags/new", method = RequestMethod.POST)
public String addTag(@Valid TagDTO tagDTO,
BindingResult result,
SessionStatus status,
RedirectAttributes attributes) {
if (result.hasErrors()) {
return ADMIN_TAGS_VIEW;
} else {
Tag tag = postService.createTag(tagDTO);
logger.info("Tag Added: {}", tag.getTagValue());
status.setComplete();
webUI.addFeedbackMessage(attributes, FEEDBACK_MESSAGE_TAG_ADDED, tag.getTagValue());
return "redirect:/admin/posts/tags";
}
}
示例6: addCategory
import org.springframework.web.bind.support.SessionStatus; //导入方法依赖的package包/类
@RequestMapping(value = "/categories/new", method = RequestMethod.POST)
public String addCategory(@Valid CategoryDTO categoryDTO,
BindingResult result,
SessionStatus status,
RedirectAttributes attributes) {
if (result.hasErrors()) {
return ADMIN_CATEGORIES_VIEW;
} else {
Category category = postService.createCategory(categoryDTO);
logger.info("Category Added: {}", category.getCategoryValue());
status.setComplete();
webUI.addFeedbackMessage(attributes, FEEDBACK_MESSAGE_CATEGORY_ADDED, category.getCategoryValue());
return "redirect:/admin/posts/categories";
}
}
示例7: onSubmit
import org.springframework.web.bind.support.SessionStatus; //导入方法依赖的package包/类
@RequestMapping(value="/make", method=RequestMethod.POST)
protected String onSubmit(
HttpServletRequest request, HttpServletResponse response,
QuestionData q,
ModelMap model,
SessionStatus status)
throws Exception {
UserSession userSession = (UserSession) WebUtils.getSessionAttribute(request, "userSession");
PlayerData player = playerService.findPlayer(userSession.getGameId(), userSession.getMemberId());
if (request.getParameterMap().containsKey("delete")) {
// delete all queued questions by sending empty list to reorder to.
ArrayList<Integer> emptyList = new ArrayList<Integer>();
playerService.reorderQueuedQuestions(player.getId(),emptyList);
// clear question in session now.
status.setComplete();
return "redirect:make";
}
else {
logger.debug("makequestion post playerid="+player.getId()+" qid="+q.getId()+" imageId="+q.getImageId());
logger.debug("================> qid="+q.getId());
request.getSession().setAttribute("qsess", q); // put question is session so it can be grabbed for verify and submit.
return "redirect:preview";
}
}
示例8: processCreationForm
import org.springframework.web.bind.support.SessionStatus; //导入方法依赖的package包/类
@RequestMapping(value = "/contato/new", method = RequestMethod.POST)
public String processCreationForm(@Valid Contato contato, BindingResult result,
SessionStatus status, RedirectAttributes redirectAttributes) {
if (result.hasErrors()) {
System.out.println("Contato in if");
System.out.println("Contato " + result.toString());
return "contato/contatoForm";
} else {
System.out.println("Contato in else");
repository.save(contato);
String msginfo = "<script>$(document).ready(function() {toastr.success('Contato incluído com sucesso !');});</script>";
redirectAttributes.addFlashAttribute("msginfo", msginfo);
status.setComplete();
return "redirect:/contato";
}
}
示例9: processUpdateForm
import org.springframework.web.bind.support.SessionStatus; //导入方法依赖的package包/类
@RequestMapping(value = "/contato/{contatoId}/edit", method = RequestMethod.POST)
public String processUpdateForm(@PathVariable("contatoId") int contatoId,
@Valid Contato contato, BindingResult result, SessionStatus status,
RedirectAttributes redirectAttributes) {
if (result.hasErrors()) {
return "contato/contatoForm";
} else {
Contato contatoUpdate = repository.findOne((long) contatoId);
contatoUpdate.setNome(contato.getNome());
contatoUpdate.setEmail(contato.getEmail());
repository.save(contatoUpdate);
String msginfo = "<script>$(document).ready(function() {toastr.success('Contato atualizado com sucesso !');});</script>";
redirectAttributes.addFlashAttribute("msginfo", msginfo);
status.setComplete();
return "redirect:/contato";
}
}
示例10: esborrarMembre
import org.springframework.web.bind.support.SessionStatus; //导入方法依赖的package包/类
@RequestMapping(value = "/area/membreEsborrar")
public String esborrarMembre(
HttpServletRequest request,
@ModelAttribute("command") AreaMembreCommand command,
SessionStatus status) {
Entorn entorn = getEntornActiu(request);
if (entorn != null) {
try {
organitzacioService.esborrarMembre(command.getId(), command.getPersona());
missatgeInfo(request, getMessage("info.esborrat.persona.area") );
status.setComplete();
} catch (Exception ex) {
missatgeError(request, getMessage("error.esborrar.persona.area"), ex.getLocalizedMessage());
logger.error("No s'ha pogut esborrar la persona", ex);
}
return "redirect:/area/membres.html?id=" + command.getId();
} else {
missatgeError(request, getMessage("error.no.entorn.selec") );
return "redirect:/index.html";
}
}
示例11: processPetCreationForm
import org.springframework.web.bind.support.SessionStatus; //导入方法依赖的package包/类
@PostMapping("new")
public String processPetCreationForm(
@Valid @ModelAttribute Pet pet,
BindingResult bindingResult,
Model model,
@ModelAttribute("id") int petId,
SessionStatus sessionStatus) {
logger.debug("processPetCreationForm()");
if (bindingResult.hasErrors()) {
model.addAttribute("mode", FormMode.Edit);
return "pet/viewOrEdit";
}
if (petId != -1) {
pet.setId(petId);
petRepository.update(pet);
} else {
petId = petRepository.insert(pet);
}
sessionStatus.setComplete();
return "redirect:/pets/" + petId;
}
示例12: signOut
import org.springframework.web.bind.support.SessionStatus; //导入方法依赖的package包/类
@RequestMapping("/logout")
public String signOut(HttpSession session, SessionStatus status, Model model) {
session.removeAttribute("rol");
session.removeAttribute("usuario");
session.invalidate();
status.setComplete();
return "redirect:login?logout";
}
示例13: submitRegistration
import org.springframework.web.bind.support.SessionStatus; //导入方法依赖的package包/类
@PostMapping("/registration")
public ModelAndView submitRegistration(@ModelAttribute("employee") Employee employeeRegistration, BindingResult result,
SessionStatus status, Model model, RedirectAttributes redirectAttributes) {
log.info("Inside submitRegistation method of Registration Controller.");
registrationValidator.validate(employeeRegistration, result);
if (result.hasErrors()) {
model.addAttribute("css", "danger");
model.addAttribute("msg", "Invalid / Missing Information. Please correct the information entered below!!");
return new ModelAndView("registration", "employee", employeeRegistration);
}
log.info("The form has no errors, so persisting the data.");
try {
employeeRegistration.setAccountStatusFlag(TimesheetConstants.REGISTRATION_STATUS_ACTIVE);
employeeRegistration.setDateCreated(new Date());
employeeRegistration.setNameUserCreated(employeeRegistration.getEmployeeFullName());
log.info("Saving the registration details of the Employee.");
registrationService.saveRegistrationDetails(employeeRegistration);
emailService.sendPlainTextMailWithoutAttachment(TimesheetConstants.fromAddress, employeeRegistration.getEmployeeEmailId(),
"",
"TechNumen Inc., Time sheet Application - Registration Successful",
"This is to confirm that you have successfully created your profile.");
status.setComplete();
} catch (Exception ex) {
log.error("Exception while saving Registration details: " + ex);
model.addAttribute("css", "danger");
model.addAttribute("msg", "Technical issue while saving the Registration information. " +
"Please contact Admin for more information!!");
return new ModelAndView("registration", "employee", employeeRegistration);
}
log.info("Successfully Registered the user, forwarding to the Login page.");
redirectAttributes.addFlashAttribute("msg", "You are successfully registered. Please Login to Continue.");
redirectAttributes.addFlashAttribute("css", "success");
return new ModelAndView("redirect:/login?encodedEmail=" + encryptDecryptUtils.encodeInputString(employeeRegistration.getEmployeeEmailId()));
}
示例14: updatePassword
import org.springframework.web.bind.support.SessionStatus; //导入方法依赖的package包/类
@PostMapping("/updatePassword")
public ModelAndView updatePassword(@ModelAttribute("employee") Employee employee, BindingResult result,
SessionStatus status, Model model, Errors errors) {
log.info("Inside updatePassword method of Registration Controller. EmployeeId: " + employee.getEmployeeEmailId());
updatePasswordValidator.validate(employee, errors);
if (result.hasErrors()) {
model.addAttribute("css", "danger");
model.addAttribute("msg", "Invalid / Missing Information. Please correct the information entered below!!");
return new ModelAndView("updatePassword");
}
try {
registrationService.updatePassword(employee.getEmployeeEmailId(), employee.getEmpPassword());
} catch (Exception ex) {
log.error("Exception while updating Employee password.");
model.addAttribute("css", "danger");
model.addAttribute("msg", "Application issue while updating your password. Please contact Admin for more information!!");
return new ModelAndView("updatePassword");
}
status.setComplete();
//Send a confirmation Email.
emailService.sendPlainTextMailWithoutAttachment(TimesheetConstants.fromAddress, employee.getEmployeeEmailId(),
"",
"TechNumen Inc., Time sheet Application - Password updated",
"This is to let you know that your password is updated successfully.");
return new ModelAndView("updatePassword");
}
示例15: freeAppointment
import org.springframework.web.bind.support.SessionStatus; //导入方法依赖的package包/类
/**
* 顾客预约托管
* @param name 顾客姓名
* @param tel 顾客手机号
* @param location 工程所在地
* @param model 预约结果信息
* @return 预约成功页面
*/
@RequestMapping(value = "/free-appointment",method = RequestMethod.POST)
public String freeAppointment(HttpServletRequest httpServletRequest, @RequestParam("name") String name, @RequestParam("tel") String tel,
@RequestParam("location") String location,Model model, SessionStatus sessionStatus){
String workerId = (String) httpServletRequest.getSession().getAttribute("workerid");
Customer customer = new Customer(name,tel,location,new Date(),"");
if(workerId != null){
WorkerInfo workerInfo = workerInfoService.queryWorkerByWorkerId(Long.parseLong(workerId));
customer.setNotes("预约[工号:" + workerId + ";姓名:"+workerInfo.getName() +
"]");
}
try{
int result = customerService.newCustomer(customer);
model.addAttribute("msg","预约成功!");
aliyunMNService.SMSNotification(3,tel);
UserInfo userInfo = userInfoService.queryByRoleId(8);
String telphone = userInfo.getTelphone();
aliyunMNService.SMSNotification(4,telphone);
sessionStatus.setComplete();
return "appointment/appointmentsuccess";
}catch (Exception e){
model.addAttribute("msg","预约失败!");
return "appointment/appointmentsuccess";
}
}