diff --git a/src/main/java/com/eactive/httpmockserver/login/controller/LoginController.java b/src/main/java/com/eactive/httpmockserver/login/controller/LoginController.java index ce25b5b..6fac2d7 100644 --- a/src/main/java/com/eactive/httpmockserver/login/controller/LoginController.java +++ b/src/main/java/com/eactive/httpmockserver/login/controller/LoginController.java @@ -2,13 +2,16 @@ package com.eactive.httpmockserver.login.controller; import com.eactive.httpmockserver.user.service.UserService; import org.apache.commons.lang3.StringUtils; +import org.springframework.http.ResponseEntity; import org.springframework.security.core.Authentication; import org.springframework.security.core.context.SecurityContextHolder; import org.springframework.security.web.authentication.logout.SecurityContextLogoutHandler; import org.springframework.stereotype.Controller; import org.springframework.ui.ModelMap; import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.servlet.ModelAndView; import javax.servlet.http.HttpServletRequest; @@ -47,7 +50,7 @@ public class LoginController { } String message = (String) session.getAttribute(LOGIN_MESSAGE); - if (StringUtils.isNotEmpty(message)){ + if (StringUtils.isNotEmpty(message)) { model.addAttribute(LOGIN_MESSAGE, message); } session.setAttribute(LOGIN_MESSAGE, null); @@ -61,14 +64,10 @@ public class LoginController { * * @return result - String */ - @GetMapping(value = "/refreshSessionTimeout.do") - public ModelAndView refreshSessionTimeout(@RequestParam Map commandMap) { - ModelAndView modelAndView = new ModelAndView(); - modelAndView.setViewName("jsonView"); - - modelAndView.addObject("result", "ok"); - - return modelAndView; + @GetMapping(value = "/refreshSessionTimeout.do", produces = "text/html;charset=utf-8") + @ResponseBody + public ResponseEntity refreshSessionTimeout(@RequestParam Map commandMap) { + return ResponseEntity.ok("success"); } @GetMapping("/actionLogout.do") diff --git a/src/main/resources/templates/page/tester/apiTester.html b/src/main/resources/templates/page/tester/apiTester.html index 0aaa4d3..f8efeeb 100644 --- a/src/main/resources/templates/page/tester/apiTester.html +++ b/src/main/resources/templates/page/tester/apiTester.html @@ -275,7 +275,16 @@