Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.beacon.corelate.training.resource;
- import org.springframework.web.bind.annotation.RequestMapping;
- import org.springframework.web.bind.annotation.RestController;
- import javax.servlet.http.HttpSession;
- import java.util.HashMap;
- import java.util.Map;
- import java.util.UUID;
- @RestController
- public class SampleResource {
- @RequestMapping("/state/new")
- public Map<String, Object> newState(HttpSession session) {
- Map<String, Object> result = new HashMap<String, Object>();
- result.put("success", Boolean.TRUE);
- String state = UUID.randomUUID().toString();
- result.put("state", state);
- session.setAttribute("state", state);
- return result;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement