Not able to access SpringContext after integrate Atmosphere framwork with spring Mvc -
After
As I type the heading spring MVC atmosphere structure
I mentioned in the integrated>, I want to use the existing LoggedIn user with the help of SecurityContext (or authentication), but gives my null when I send ajax request from jsp page (client side).
There is a problem with my code or some other problem below is my MyController.java and jsp files
MyController.Java
@Controller public class MyController {@Autowired PartyManagementService partyManagementService; @RequestMapping (Value = "/ WebSockets", Method = RequestMethod.POST) @ResponseBody Public String Post (Last AtmosphereResource Event, @RequestBody String Message) JsonGenerationException, JsonMappingException, IOException {User User = (User) SecurityContextHolder.getContext () throws . . GetAuthentication () getPrincipal (); String Username = user.getUsername (); Person person = party management service. Gartersprom usernames (usernames); Logger.info ("Message received for broadcast: {}", message); Final Int Nautilix = Event.GetBreatstrator (). GetAtmosphereResources () Shape (); Event.getBroadcaster () broadcast (message). "Send message successfully"; }}
home.jsp
In my house jsp I request ajax which provide push messages to the server.
Comments
Post a Comment