Skip to main content

Posts

Showing posts with the label spring

Use Client Certificate Authentication with Java and RestTemplate

As a follow up of the  http://gochev.blogspot.com/2019/04/convert-pfx-certificate-to-jks-p12-crt.html  we now have a keystore and a truststore (if anyone needs) and we will use this keystore to send client side authentication using Spring's RestTemplate . First copy your keystore.jks and truststore.jks in your classpath, no one wants absolute paths right ?:) Again a reminder  The difference between truststore and keystore if you are not aware is(quote from the   JSSE ref guide ) :   TrustManager: Determines whether the remote authentication credentials (and thus the connection) should be trusted. KeyManager: Determines which authentication credentials to send to the remote host. The magic happens in the creation of SSLContext. Keep in mind the Spring Boot have a nice RestTemplateBuilder but I will not gonna use it, because someone of you might have an older version or like me, might just use a plain old amazing Spring. If you just want to use the ke...

Spring one 2gx conference review

Last week I was able to visit the Spring One 4gx conference in Washington, D.C. SpringOne4gx is an annual conference made by Pivotal usually held in September each year but on different location in USA each time. I have to share that this was the BEST conference I have attended to in my whole life. The conference was taking place at Marriott Marquis which was a cool place, the only big minus was that it was extremely cold, but I believe this is an issue about US in general (very warm outside and cold inside - yes it was strange indeed). This was my first visit to USA so I had to say that I am not impressed, many poor peoples sleeping on the streets and at least 1 different crazy day each day (shooting with virtual rifle or talking to strangers and etc.) anyway if this is capitalism I don't like it. About the conference itself: the conference was in 4 days, the first day was mostly only, a keynote and registration + a diner. I have to say that the conference tickets was coveri...

Introduction to Spring MVC (In Bulgarian)

This is video from the presentation I did for Software University  at Sofia, Bulgaria. Camera : Screen capture : All demos can be downloaded from here https://github.com/gochev/examples/tree/master/SoftUni%20Spring%20MVC%20June%202015 If you missed the event .. don't miss the next one. In Bulgarian Java User Group we do events like this one every month. Information about past and future events can be found here http://java-bg.org/events/

What is jHipster at SoftUni Conf, March, 2015

This is a small 10min talk that I made about jHipster. JHipster is a yeoman generator that can create a spring boot/jpa application with angular and bootstrap for a minute. I am not fan of code generation but .. its something that may help us doing presentations or preparing an example. The talk is in Bulgarian again

RAD with Spring @SoftUni Conf, March, 2015

This is a video of the presentaiton about Rapid Application Development with Spring that I made at SoftUni conf. The video is in Bulgarian :( ... again :( Example can be found here : Example on github

Software University : Fast REST API with Spring

This is video from the presentation I did for Software University   conf  at Sofia, Bulgaria. And here is the presentation (slideshare) only. All demos can be downloaded from here https://github.com/gochev/examples/tree/master/SoftUni%20Rest%20Spring If you missed the event .. don't miss the next one. In Bulgarian Java User Group we do events like this one every month. Information about past and future events can be found here http://java-bg.org/events/

spring-loaded rocks !

Today I found spring loaded ( https://github.com/spring-projects/spring-loaded ) in short this is a java agent that enables class reloading of already running VM. Simply this means zero deployment time (in many cases). It is like a free and open source alternative of JRebel. Spring Loaded allows you to add/modify/delete methods/fields/constructors. The annotations on types/methods/fields/constructors can also be modified and it is possible to add/remove/change values in enum types. There is a preliminary java8 support. There is also another project DCEVM ( which is also great but supports only till JRE 6 update 26). More info here http://ssw.jku.at/dcevm/ But lets stop speaking and show you how it works. In short you just need to pass the agent when starting the vm and that’s it. >java -javaagent:D:/Downloads/springloaded-1.2.0.BUILD-20140409.201438-12.jar -noverify org.gochev.MainClass I am using this Build since I am running Java 8 and this is currently the latest . The ...

Spring MVC, Spring Bean Validation Framework and validating confirm password / confirm email fields.

How to write validation like confirm password, confirm email and etc in Spring MVC. NOTE: To make bean validation to work its nice to read this tutorial: <a href=" http://wheelersoftware.com/articles/spring-bean-validation-framework.html" ></a> Today I was busy making some validations and implementations on very common scenario: change email and password. So we have a new password AND a new email also for both of them we have a confirm email/password field. And we want to validate everything nicely and to show to the user the real validation message if there is some error. So ... I've to use a form which already uses some annotations like @NoBlank and etc I think everyone of you is using annotations framework if you don't use it SHAME ON YOU !:) Anyway so I've added some fields to existing form bean: private String newPassword; private String confirmNewPassword; private String newEmail; private String confirmNewEmail; Bas...