Posts

Spring MVC: Trgger manual validation of a form object

Sometimes it may be needed to use manual validation in Spring MVC @Controller. This is very simple with Spring’s org.springframework.validation.ValidationUtils class. Learn how to invoke a validator in two different scenarios. Scenario 1 - invoke validation In this scenario, I have a user form with username field. Username field is validated with custom validator in order to verify the existance in e.g. database. public class User { @UserExists private String username; } In controller class I have a method that handles POST method of that object: @Autowired private org.springframework.validation.Validator validator; @RequestMapping(value = "/user", method = RequestMethod.POST) public String validate(@ModelAttribute User user, Errors errors) { ValidationUtils.invokeValidator(validator, user, errors); if (errors.hasErrors()) { // error, show errors to the user } // success, form is valid! } org.springframework.validatio...

Quickstart: Angular2 with TypeScript and Gulp: Watch For File Changes

In this part of Quickstart: Angular2 with Typescript and Gulp I will walk you through adding watch task to angular2-typescript-gulp project so changes in source directory are reflected in the build directory.

Quickstart: Angular2 with TypeScript and Gulp: TSLint

In this part of Quickstart: Angular2 with Typescript and Gulp I will walk you through adding TypeScript Lint to angular2-typescript-gulp project. TSLint checks TypeScript code for readability, maintainability, and functionality errors and in Gulp it can be used with gulp-tslint plugin.

Quickstart: Angular2 with TypeScript and Gulp

Image
Angular2 is out. The new version of the framework is much simpler to learn thanks to easier and more concise concepts like component-based architecture, new dependency injection or built-in modularity. In this step-by-step tutorial you will learn how how to get started with Angular2 with TypeScript and Gulp. Source code available on Github.

Skip SSL certificate verification in Spring Rest Template

How to skip SSL certificate verification while using Spring Rest Template? Configure Rest Template so it uses Http Client to create requests.