devxlogo

Web Development

Spring Admin Expiring all Session of a Certain User

http .formLogin().loginPage(“/login”).successForwardUrl(“/”).defaultSuccessUrl(“/”) … .sessionManagement().maximumSessions(1).maxSessionsPreventsLogin(false) .sessionRegistry(sessionRegistry()) …@BeanSessionRegistry sessionRegistry() { return new SessionRegistryImpl();}@Autowiredprivate SessionRegistry sessionRegistry;sessionRegistry.getAllPrincipals().stream().filter((principal) – (principal instanceof User)).map((principal) – (UserDetails) principal).filter((userdetails) – userDetails.getUsername().equals(email))).forEachOrdered((userDetails) – { sessionRegistry.getAllSessions(userDetails, true).forEach((information) -{ information.expireNow(); }); });

Displaying the Euro Sign in a Textbox

Don’t you just hate it that the Euro monetary symbol is not present on all computers? With this simple trick you can add the Euro sign to a textbox. Put