Index: core-module/pom.xml =================================================================== diff -u -r3f813b3844a54ad2003c22f245427e088a89cb87 -rd0e7bd8c18c3d9c32f77ed15e858c36d1c0cb010 --- core-module/pom.xml (.../pom.xml) (revision 3f813b3844a54ad2003c22f245427e088a89cb87) +++ core-module/pom.xml (.../pom.xml) (revision d0e7bd8c18c3d9c32f77ed15e858c36d1c0cb010) @@ -7,7 +7,7 @@ 313devgrp jstree-project - 19.07.07 + 19.07.08 ../pom.xml @@ -31,7 +31,7 @@ 313devgrp lib-module - 19.07.06 + 19.07.08 pom Index: core-module/src/main/java/egovframework/com/ext/jstree/support/security/controller/PagesController.java =================================================================== diff -u -r4987929cac9e36aa7f7e3eba63e6226c208f5330 -rd0e7bd8c18c3d9c32f77ed15e858c36d1c0cb010 --- core-module/src/main/java/egovframework/com/ext/jstree/support/security/controller/PagesController.java (.../PagesController.java) (revision 4987929cac9e36aa7f7e3eba63e6226c208f5330) +++ core-module/src/main/java/egovframework/com/ext/jstree/support/security/controller/PagesController.java (.../PagesController.java) (revision d0e7bd8c18c3d9c32f77ed15e858c36d1c0cb010) @@ -18,22 +18,12 @@ @RestController public class PagesController { - @RequestMapping(value = "/login", method = { RequestMethod.GET, RequestMethod.POST }) - public ModelAndView login(HttpServletRequest request, HttpServletResponse response) throws ServletException,IOException { - ModelAndView model = new ModelAndView(); - model.addObject("title", "Login Page"); - model.setViewName("egovframework/com/ext/jstree/support/security/login"); - return model; - } - + @ResponseBody @RequestMapping(value = {"/userpage"}, method = { RequestMethod.GET, RequestMethod.POST }) public ModelAndView userPage() { - - ModelAndView model = new ModelAndView(); - model.addObject("title", "Spring security social login Hello World"); - model.addObject("user", getUser()); - model.setViewName("egovframework/com/ext/jstree/support/security/user"); - return model; + ModelAndView modelAndView = new ModelAndView("jsonView"); + modelAndView.addObject("user", getUser()); + return modelAndView; } @ResponseBody Index: core-module/src/main/java/egovframework/com/ext/jstree/support/security/controller/SecurityController.java =================================================================== diff -u -r823d57b373afdb8eebc9d80a1eeabea0313fbde6 -rd0e7bd8c18c3d9c32f77ed15e858c36d1c0cb010 --- core-module/src/main/java/egovframework/com/ext/jstree/support/security/controller/SecurityController.java (.../SecurityController.java) (revision 823d57b373afdb8eebc9d80a1eeabea0313fbde6) +++ core-module/src/main/java/egovframework/com/ext/jstree/support/security/controller/SecurityController.java (.../SecurityController.java) (revision d0e7bd8c18c3d9c32f77ed15e858c36d1c0cb010) @@ -1,15 +1,29 @@ package egovframework.com.ext.jstree.support.security.controller; import egovframework.com.ext.jstree.support.mvc.GenericAbstractController; +import org.springframework.security.web.csrf.CsrfToken; import org.springframework.stereotype.Controller; +import org.springframework.ui.ModelMap; import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.ResponseBody; +import org.springframework.web.servlet.ModelAndView; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpSession; + @Controller @RequestMapping(value = {"/api/jsTreeServiceFramework/security"}) public class SecurityController extends GenericAbstractController { - @RequestMapping("/csrf.do") - public String jsTreeCSRFtoJson() { - return "egovframework/com/ext/jstree/csrf"; + @ResponseBody + @RequestMapping(value = {"/csrf.do"}, method = { RequestMethod.GET, RequestMethod.POST }) + public ModelAndView jsTreeCSRFtoJson(HttpSession session, ModelMap model, HttpServletRequest request) throws Exception { + CsrfToken token = (CsrfToken) session.getAttribute("HttpSessionCsrfTokenRepository.CSRF_TOKEN"); + //return "egovframework/com/ext/jstree/csrf"; + ModelAndView modelAndView = new ModelAndView("jsonView"); + modelAndView.addObject("result", token.getToken()); + return modelAndView; } + } Index: lib-module/pom.xml =================================================================== diff -u -r3f813b3844a54ad2003c22f245427e088a89cb87 -rd0e7bd8c18c3d9c32f77ed15e858c36d1c0cb010 --- lib-module/pom.xml (.../pom.xml) (revision 3f813b3844a54ad2003c22f245427e088a89cb87) +++ lib-module/pom.xml (.../pom.xml) (revision d0e7bd8c18c3d9c32f77ed15e858c36d1c0cb010) @@ -5,7 +5,7 @@ 313devgrp jstree-project - 19.07.07 + 19.07.08 ../pom.xml Index: pom.xml =================================================================== diff -u -r3f813b3844a54ad2003c22f245427e088a89cb87 -rd0e7bd8c18c3d9c32f77ed15e858c36d1c0cb010 --- pom.xml (.../pom.xml) (revision 3f813b3844a54ad2003c22f245427e088a89cb87) +++ pom.xml (.../pom.xml) (revision d0e7bd8c18c3d9c32f77ed15e858c36d1c0cb010) @@ -10,7 +10,7 @@ 4.0.0 313devgrp jstree-project - 19.07.07 + 19.07.08 pom jstree-project