-
Custom Password Constraint Validator Annotation Example
This tutorial demonstrates how to create a custom password validator annotation using custom password rules. You’ll be able to annotate your password field with a @ValidPassword. This’ll trigger the custom PasswordConstraintValidator which’ll enforce a server-side password policy.
轻舞肥羊2019-08-10【[Java]】
阅读更多 -
Integrate Google ReCaptcha Java Spring Web Application
This tutorial demonstrates how to integrate Google ReCaptcha into a Java Spring Web Application. reCAPTCHA is used to verify if the current computer is a human, preventing bots from automatically submitting forms. We integrated Google ReCaptcha using server side validation. We wrote a custom @ReCaptcha annotation which you can annotate your java fields. This’ll automatically handle the ReCaptcha server side validation process. At the bottom we also wrote some Unit and Integration tests using Mockito, spring-test and MockMvc.
轻舞肥羊2019-08-10【[Java]】
阅读更多 -
Field Matching Bean Validation Annotation Example
This tutorial demonstrates a Field Matching Bean Validation Annotation Example. When you are building forms you may come across a requirement to validate/compare if different fields inside a form are equal to another field in the same form like password and/or email fields. In this example we build a simple form where we have a password and a confirmPassword field. We need to make sure the user has entered the correct password twice before submitting the request.
轻舞肥羊2019-08-10【[Java]】
阅读更多 -
Spring Security In Memory Authentication Example
This tutorial demonstrates how to configure Spring Security to use In Memory Authentication. We can easily customize the Spring Security AuthenticationManager to use Spring Security in memory authentication and add multiple users with different attributes, authorities and roles. In this example we used HTTP Basic Authentication with stateless configuration for securing rest full web services. We also demonstrate how to create some Integration Tests using MockMvc.
轻舞肥羊2019-08-10【[Java]】
阅读更多 -
Spring Security Remember Me Hashing Authentication Example
In this tutorial we demonstrate how to create a Spring Security Remember Me Hashing Authentication application. Remember me authentication is a feature that allows web sites to remember the identity of a user between sessions. Spring security provides two remember-me implementation. One uses hashing to preserve the security of cookie-based tokens which we’ll tackle in this tutorial. The second uses a database or other persistent storage mechanism to store the generated tokens.
轻舞肥羊2019-08-10【[Java]】
阅读更多 -
Spring Mail Sending Simple Email with JavaMailSender Example
In this tutorial we demonstrate how to send a simple email using spring mail and spring boot. First we configure our email properties using a YAML or Properties file.
轻舞肥羊2019-08-10【[Java]】
阅读更多 -
Spring Mail Sending Email Attachment Configuration Example
This tutorial demonstrates how to send an email with attachment using spring framework. We can add an attachment to a MimeMessage using the MimeMessageHelper.
轻舞肥羊2019-08-10【[Java]】
阅读更多 -
Spring Mail Sending Email with Inline Attachment Example
This tutorial demonstrates how to send an email with an inline attachment using spring framework. We can add an attachment to a MimeMessage using the MimeMessageHelper.
轻舞肥羊2019-08-10【[Java]】
阅读更多 -
Spring Mail Sending Email with Freemarker HTML Template Example
In this tutorial we demonstrate how to send a HTML email using a custom freemarker template using spring framework. In this topic we learn how to create and configure a custom freemarker template using spring.
轻舞肥羊2019-08-10【[Java]】
阅读更多 -
Spring Mail Sending Email with Thymeleaf HTML Template Example
In this tutorial we demonstrate how to send a HTML email using a custom thymeleaf template using spring framework. In this topic we learn how to create and configure a custom thymeleaf template using spring.
轻舞肥羊2019-08-10【[Java]】
阅读更多 -
Spring Mail Integration Testing with JUnit and GreenMail Example
In this example we show how to use Spring Mail and write Integration Tests using JUnit and GreenMail. We start by writing a simple email service that sends out emails. We want to verify that this email service sends out correct emails, so we use GreenMail – which is an open source test suite of email servers for testing purposes.
轻舞肥羊2019-08-10【[Java]】
阅读更多 -
Spring LDAP + Spring Boot Embedded LDAP Configuration Example
In this tutorial we demonstrate how to use spring boot and spring ldap to configure an embedded LDAP server.
轻舞肥羊2019-08-10【[Java]】
阅读更多 -
Spring LDAP Mapping Attributes to POJO with AttributesMapper Example
This tutorial demonstrates how to use spring LDAP to map attributes on a POJO using the AttributesMapper<T> class.
轻舞肥羊2019-08-10【[Java]】
阅读更多 -
Spring LDAP CRUD Operations Binding and Unbinding Example
In this tutorial we use spring ldap to demonstrate CRUD (Create, Read, Update Delete) operations performed on an LDAP server.
轻舞肥羊2019-08-10【[Java]】
阅读更多 -
Spring LDAP Object Directory Mapping (ODM) Configuration Example
In the following tutorial we demonstrate how to use Spring LDAP Object Directory Mapping (ODM). ODM offers developers the ability to use annotations to map LDAP directories to Java objects.
轻舞肥羊2019-08-10【[Java]】
阅读更多