devxlogo

Web Development

RESTful Verbs

HTTP RESTful ObservationGET Read safe and idempotentPOST Create neither safe nor idempotentPUT Update not safe, but idempotentDELETE Delete not safe, but can be considered idempotent

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