A guide to using JSON Web Tokens with both symmetric and asymmetric signing in Spring Security OAuth.
I’m a software engineer with a passion for REST, TDD and clean code, Web Security and Data Mining. Baeldung is about all of these and more.
Here's what I've written (so far):
Baeldung on Java
- Weekly Review (152)
- Spring (38)
- Spring Security (29)
- Java (29)
- Guava (27)
- REST (23)
- HTTP Client-Side (20)
- JSON (19)
- Jackson (18)
- Data (17)
- Java Collections (12)
- Testing (9)
- Spring MVC (8)
- Maven (7)
- JPA (7)
- Spring Persistence (6)
- Persistence (6)
- Spring Web (5)
- Java String (5)
- Spring Data (4)
- Spring Boot (4)
- Programming (4)
- Security (2)
- Java Array (2)
- Cloud (2)
- Java Map (1)
- Java Concurrency (1)
A quick and practical set of examples for using the core Scanner Class in Java – to work with Strings, Files and user input.
A quick exploration of Tabnine – a really cool coding assistant that make development simpler, and most importantly – a lot faster.
A clear look at the Java ecosystem in 2018.
Spring MVC configuration – both Java and XML – on a simple Spring MVC project.
The final results of the “Java in 2017” Survey.
A quick review this week, but one with some depth to it. And of course some Hibernate goodness.
An packed week with solid talks on Java 9 and of course the upcoming Spring reactive stuff, microservices and tracing requests through a distributed system.
Reactive is slowly becoming mainstream (both in and outside of Spring), proper logging is more important than ever and AWS is launching a host of new instance types.
This week we’re talking about the JCP, the ELK stack and missing features in the Java streams implementation. Plus a host a fantastic talks.
Looking beyond Java 9, going back to basics with value objects and developer productivity. Overall, an interesting and diverse week.
Lots of great releases in the Spring ecosystem, a look at the performance improvements in Java 9 and some job negotiation advice that could make a difference.
This week was focused on Java 9, new Spring Cloud goodness and finally getting Guava 20. Good stuff all ’round.
A week focused on Microservices, JUnit 5 and good DNS practices to become more resilient to DDOS attacks.
An interesting week with a clear focus on the reactive programming trend that’s seeing traction in the Java community.
This week is all about Hibernate it seems, with some great JavaOne roundups and talks and a solid writeup on microservices.
This week is all about reactive – both in the upcoming Spring 5, but also RxJava and Reactor 3. A very interesting week, full of solid writeups.
Java 9 is officially delayed, we have a new schedule for Java EE 8 as well, and also lots of cool stuff coming out of JavaOne.
New info about Java EE, an insightful breakdown of Java framework usage and an all to real look at how Eclipse is doing in 2016 (not great).
A packed week starting with a deep-dive into Java 9, lots of SpringOne talks, a solid writeup on ElasticSearch tuning and a piece about troubleshooting
A packed list of great writeups this week, with a clear focus on security, a great JUnit 5 cheat sheet and some Java 8 collectors goodness.
A forward-looking week of content, talking about JUnit 5, reactive programming and the plans for Java EE 8.
A quick guide on how to integrate Google’s reCAPTCHA to the user registration process in order to differentiate human from bots.
A relaxed week after SpringOne, but still chock full of goodness with the new plans for Spring 5, a solid analysis of the code of reflection among other things.
Quick and practical guide to different ThreadPool implementations in Java and Guava.
An packed week starting with Hibernate advice and SpringOne and wrapping up with technical debt and the impact it can have on teams.
Form one step closer to Spring 5 to low level JVM compiler optimizations – some solid writeups this week.
The Java “State of the Union”, a look at JUnit 5 and some cool notes on reactive programming – quite an interesting week.
The first milestone of JUnit 5 is out, we have another solid deep-dive into the issues of a persistence solution and some of the best StackOverflow questions ever.
Quite an interesting week with Java 9 almost ready to commit to a hard date, a solid HATEOAS writeup for the Spring ecosystem and lots of releases and goodness.
Java 9 ads new Optional goodness, some good advice on public speaking and all about JIT compilation this week.
A news heavy week with JDK 9 missing feature completion, some Java EE 8 turmoil, on the release of Spring 4.3.
Very interesting numbers showing IntelliJ picking up users from both Eclipse and other IDEs in the last couple of years.
This week, some cool writeups all about reactive programming coming to Spring as well as insights out of a huge dataset of Java exceptions.
A well thought out writeup on deploying to production with Spring and some solid advice on why events make a lot of sense for microservices.
An interesting and diverse week, from some Java persistence goodness to a well-executed Spring Boot migration and the LinkedIn data breach.
Another solid week with a lot of releases, some interesting blogging plans and a host of good talks.
A deeper look at the upcoming JUnit 5, the new version of Spring Security and some interesting musings on how code reviews are shaping our industry.
Some cool additions to Spring Data, o solid piece on Hypermedia APIs and of course musings on microservices. A pretty good week.
After reading the enthusiastic Join me at GeeCON article I was inspired to do a quick writeup about the conferences that are coming up in the month of May. I’m super excited about May; first off, there’s GeeCON, starting on the 11th and wrapping up on the 13th and then SpringIO in Barcelona, on the […]
Some interesting Hibernate goodness, a fun read about startups and a new course I’m excited about. All in all, a good week.
A packed week with thoughts on Java generics, the state of Java EE and lots of Kotlin goodness.
A packed with with a focus on JUnit 5, the second RC of Spring Boot and avoiding burnout as a programmer. Good stuff.
Jenkins 2, JUnit 5, Spring 5 – yeah, we’re definitely getting close to some exciting releases. A solid week chock full of solid writeups.
Local variable type inference, a quick and useful way of running your JUnit tests more predictably and the first RC of Spring Security 4.1 – an exciting week.
New numbers on the Spring and Spring Boot adoption in the ecosystem in March 2016.
An interesting week focused on culture, hiring and firing but definitely also on the upcoming developments in Java 9 and Spring 5.
New numbers for the adoption of Java 8 in March of 2016.
The details of Spring IO are out, Java 10 might be getting a significant syntax upgrade and the talks that have come out this week are quite interesting. Not too shabby.
Running the Java and Spring 2016 Survey here on Baeldung.
Some solid writeups this week, from maintaining an API for multiple versions of Java, to what’s happening with the Unsafe cleanup in Java 9.
JUnit 5 is picking up the pace, lambdas are still fun to play with and a host of solid talks for the weekend. A good, interesting week.
An interesting week with JUnit finally moving forward, new Hibernate documentation and some reactor updates in the Spring ecosystem.
Some very interesting writeups this week, from API design principles to security breaches and the plans for Spring 5.
A deep dive into JVM level optimizations coming to JDK 9, a cool intro to Hystrix to build up architecture resiliency and a few other solid writeups this week.
This article demonstrates two ways to return custom HTTP status codes from Spring MVC controllers: using ResponseEntity and using exceptions.
A solid week with some interesting pieces on general application security, the Java browser plugin and Hibernate training. Cool stuff.
A very interesting deep-dive into feature toggles, a host of Groovy talks and some good Java advice. This week dropped some knowledge on our collective asses.
Cool writeups this week – from a deep dive into less known nuances of the Java Stream API, through JPA focused test-cases for Hibernate and productivity tips.
The Java language has seen huge growth in 2015, good API design is as difficult as ever and good git commits are actually possible. A solid first week of 2016.
A quick holiday week with a few solid topics such as multiline String support in Java and hiring developers well. Happy New Year.
A quick guide to using Spring Batch for a simple but practical scenario – moving some data from CSV to XML.
A simple and practical guide to using LDAP and LDIF with Spring Security.
A busy holiday week for the whole Java ecosystem – an alternative to the deprecation JEP, lots of good talks and an intelligent writeup about giving advice.
Interesting writeups this week from reducing the GC overhead of your app, to a new HTTP status code – the 451 and the evolution of the way Java does versions
A solid week, as we’re edging closer to 2016, with good writeups on the Java 8 Streams API, the memory consumption of a Spring app, and some Mockito goodness.
Simplify the Data Access Layer by using a single, generified DAO, which will result in elegant data access, no unnecessary clutter.
From the schedule push of Java 9 to a lot of Spring goodness, this week was certainly packed with solid writeups.
The Java ecosystem is moving forward this week with most writeups about Java 8 and 9, along with the first cool JUnit prototype.
Lots of releases – Spring and otherwise, a solid writeup about dates and additional Java One notes. A cool week.
A quick intro to the web support in Spring Data JPA Querydsl and how to easily set that up within a REST API.
Learn how to start working with JSON data in Java.
Some solid Java 9 writeups this week, a cool analysis of Spring Session and a couple a interesting musings on good communication.
This week was focused on Java 9 and persistence, with a few solid releases layered in.
Quite an interesting week for the Java ecosystem, with Java One wrapping up yesterday and a ton of fixes in a new JDK release.
Solid deep-dives this week as well as a host of Spring presentations and of course some musings about architecture and teams.
An interesting and diverse week with some cool CQRS pieces, a quick foray into CI and a round of discoverability.
From a look into Java EE 8 Controllers, the new Spring STS to some must-read musings about freelancing – this week was solid.
A lot of Spring goodness this week, along with a few strong Ops pieces on orchestrating a deployment for a microservice architecture, or opening up log data.
A light week with some great writeups on Event Sourcing, caching static artifacts and some good advice on positioning.
A name change for the “Baeldung Weekly Review”, API Hypermedia controls, soft assertions and a strong focus on shipping your work. A great week.
The module system due in Java 9 is quickly moving forward, CQRS and Event Sourcing are gaining ground and Spring Boot plays well with JAX-RS to make up a very diverse week.
Learn how to start moving an existing Spring REST API towards a CQRS-centric architecture.
A few solid Spring releases, some great insights into DDD and CQRS and a new way to work with SQL from Java. A good week.
An even spread this week between solid Spring writeups on microservices and the odd DDD focused piece. Some solid reading.
Definitely a good week with a JDK release, some Spring coolness and musings about stepping out of your comfort zone.
Some interesting pieces this week, about the new Java REPL, mixing Clojure with Java and Spring and application tuning and profiling.
Spring 4.2 is out this week, along with a deep dive on Jigsaw and a host of other goodness. Definitely a packed week.
Mapping Akka, handling properties elegantly and the Java 9 REPL – a pretty good week.
Further Java 9 news, testing web apps with the page object pattern and a great look at static analysis benefits.
A guide to redirect and forward in Spring MVC, with a focus on the code and implementation of each strategy.
Feedback on JDK9, the sun.misc.Unsafe removal discussion and some cool upgrades – all in the course of one week.
Java 9, DevOps and Microservices. Despite the buzzwords, some good pieces this week.
A week chock-full of Spring releases. A nuanced discussion on the trade-offs of microservices. And a piece on office politics. A good week overall.
Eclipse Mars is out this week, along with a very good piece on putting a Gateway in front of your Microservices and some cool stuff out on AWS.
An eventful week with writeups about Java 9 and Spring Boot 1.3 ramping up.
A good rebuttal of the “start with a monolith” piece from last week, some very cool ETag support in Spring Data REST and a discussion of Java testing tools.
The core of Jackson is basically a set of annotations – make sure you understand these well.
This week is chock-full of solid writings – from what what the role of a senior developer is all the way to microservices and monoliths. A good week.
Some of the more useful configs for a Spring Boot application.
How to control which fields get serialized/deserialized by Jackson and which fields get ignored.
How to serialize Maps with a null key or null values using Jackson.
Survey results on the adoption of Java 8, Spring 4 and the newer Spring Boot across the industry.
Quite an interesting week with the release of the first RC of Spring 4.2 and some solid pieces on Microservices and CQRS.
The weekly takeaways include a good overview of monitoring solutions, some cool notes on testing an Angular+Spring app and of course my ongoing survey.
How to enable, configure and make good use of the Caching Abstraction in Spring.
Quite a diverse week with some solid pieces on the Spring blog and the mandatory microservices post.
An interesting week with the announcement of the Java 9 timeline as well as some cool pieces on distributed systems and a host of Spring talks. Good stuff.
A light week with a few good pieces on caching in Hibernate, Eclipse Mars and general life advice.
A week full of must-reads – from pragmatic career advice for developers that are new in the field, to solid, grounded advice on password use.
A solid week discussing accidental complexity, microservice topologies and great commit messages.
Lean how to implement a Search/Query Language for a Spring REST API using the standard Feed Item Query Language instead of a custom syntax.
Clean tests, logging management solutions and Java 8, and some very cool releases from AWS. A packed week.
How to enable the user to update/change their own password after logging into the app.
Testing and Spring goodness this week, as well as some musings about introversion and leadership. A good, diverse week.
How to implement and graph HTTP metrics into a Spring REST API – status code counts, counts by request, time-series data, etc.
Major Spring releases this week and some great insights into working in corporate and working for yourself. Day and Night.
Making the Registration API more RESTful and adapting the front-end to correctly consume it.
Microservices? Check. Top 10 lists? Check. Great Comics? Check. All in all, quite a diverse week.
An interesting and diverse week, from the plans for Java 9 to joys of Yak Shaving. Enjoy.
A new JEP slated for Java 9, some cool advancements for dealing with the Http Session (finally) and a piece about “Why NOT git”. A cool week all in all.
A quick introduction to how to authenticate your application with Spring Security and the Reddit OAuth2 API.
First – time to upgrade Spring with all the new releases this week. And of course a host of cool articles, such as an exploration of code ownership models.
If the user registers and forgets to verify their account, the verification link will expire. This is how to allow them to request a new one.
How to implement a mature, tested Query Language for a REST Search API, using Spring and Spring Data JPA Specifications.
HTTP 2 is final – the big news of this week (it has been a while since the last one). Also – some cool deep dives into the JVM and Hibernate.
Every app should enable users to change their own password in case they forget it.
Block users by IP after a number of failed authentication attempts – a simple mechanism implemented with Spring Security.
A busy week for the Spring ecosystem, with Spring 4.2 getting closer and closer. A discussion about timezones as well – what more do we need?
Some great Java back-to-basic articles, insights into building APIs and a discussion about backups. Good first week of February in my book.
How to set up Spring Data JPA to work with multiple, separate databases.
How to build a search/filter functionality into a REST API with Spring and Querydsl.
A reference Spring piece on building a proxy, a deep dive into Java 8 and a good read on Agile (of all things) – all in all, a pretty good week.
How to implement a query language for a REST API using Spring Data Specifications.
An introduction to implementing a simple but very useful serach/filter operation on your Spring REST APIs using JPA Criteria.
Introduction to the Spring JDBC abstraction, with example on how to use the JbdcTempalte and NamedParameterJdbcTemplate APIs.
A lot of great reads this week, starting with some Spring Security goodness, a number-heavy benchmark of the Java parallelism frameworks and of course some Dilbert.
Lots of Spring reference articles this week and of course the Java 8 goodness we’ve all come to expect by now. Also – the first time I include the “Pick of the Week” right in the review.
How to map Roles and Privileges for a Spring Security application: the setup, the authentication and the registration process.
Full steam ahead – some solid Java 8 pieces and Java 9 news, a few Spring tutorials to take note of and of course, the great technical musings of the week.
How to encode password when registering (and authenticating) a new user – with Spring Security and BCrypt.
All the Baeldung weekly reviews of 2014.
The first review of 2015 and some interesting Java 8 and Java 10 (yeah) information, as well as a handful of highly useful musings and ruminations.
How to use Jackson to break the infinite recursion problem on bidirectional relationships.
How to POST with HttpClient 4 – from a basic request, to authentication, multipart requests, uploading files and tracking the progress of long running operations.
A quiet week with a few good articles but not a whole lot of activity overall. Also the last review of 2014 – enjoy this one.
Here are the most read articles on the site written in 2014.
The most common Jackson exceptions – the cause of the problem and the solution for each one.
How to best set up Transactions in Spring – the configuration, Transaction Propagation and which layer should have Transactional Semantics.
JDK 9 modularization news, Java 8 streams and Spring Boot – what more can you expect from a good week like this one?
How to use the @JsonView annotation in Jackson to perfectly control the serialization of your objects (without and with Spring).
One of the more eventful weeks of the year, with some fantastic Spring Boot pieces (and new releases), musings on CQRF and a good read on Flexibility vs Simplicity.
How to enable and use @Async in Spring – from the very simple config and basic usage to the more complex executors and exception handling strategies.
A long list of solid pieces this week, starting with some good practices for non-trivial Java projects, to more JDK 9 news and a lot of cool Spring stuff being released.
Verify newly registered users by sending them a verification token via email before allowing them to log in – using Spring Security.
HttpAsyncClient Tutorial – send a basic GET request, use the multi-threaded client, set up the client with SSL as well as with a proxy, and finally – do authentication.
The Best actively maintained sites in the Java ecosystem.
Lot happening in Java land – starting with how to understand and tune your severs. Some very interesting uses of Spring Boot and the new Spring Session project.
This week we got some visibility into Java 9, a great microservice deck and tips and tricks for using thread pools.
Calculate the Size of a Directory with Java 6, 7 and 8 as well as Apache Commons IO and Guava.
Use the Guava CharMatcher to work with Strings – remove special chars, validate, trim, collapse, replace and count among other super useful APIs.
How to use annotations in Mockito – @Mock, @Spy, @Captor and @InjectMocks and the MockitoJUnitRunner to enable them.
This week was all about the next version of Java – the language is definitely not standing still. That and a host of useful Spring replays from SpringOne.
The Basics of Events in Spring – create a simple, custom Event, publish it and handle it in a listener.
How to map and handle static resources with Spring MVC – use the simple configuration, then the 3.1 more flexible one and finally the new 4.1 resource resolvers.
How to define and use Profiles in Spring. The 4 ways to enable profiles and their precedence. And a real-world example using profiles.
This was quite a week and so we have an interesting roundup. Lots of solid Java and Spring articles as well as some other useful pieces on leadership and affecting positive change.
Making good use of Spies in Mockito, and how spies are different from mocks.
Working with the Guava Map support to create immutable, sorted, bi and multi maps, as well as other useful map implementations.
Building a REST Service with Spring and Java based Configuration, HTTP response codes, REST payloads and marshalling, testing.
Working with Sets in Guava – intersection, union, cartesian product, set of ranges and other useful code samples.
Work with Lists in Guava – clean duplicates and nulls from the list, reverse it and partition it – or convert it to an ImmutableList.
Using the Java Timer and TimerTask to get the most out of it. Schedule a delayed one time task, a daily task or just repeat on an interval. Cool beans.
This week is definitely Spring heavy – lot of solid Spring Boot pieces that show how the framework is maturing. Some interesting JVM articles as well.
How to Write to File and Read from a File using the Guava IO support and utilities.
A week about Agile, building communities and patch operations in Spring – so not a bad week.
How to use the Guava Splitter and Joiner to convert to and from collections and Strings.
How to use the @Scheduled annotation in Spring, to run tasks after a fixed delay, at a fixed rate or according to a cron expression.
Wide array of articles from HTTP/2 moving forward, through using testing as the main driver of your design and to the useful lessons in Microservices.
Filter collections with Predicates and transform them with Functions using the Guava library.
Some solid articles this week, on code coverage (being a useless metric), interesting JSON Patch Spring experiments and a new installment in the Chess TDD Series.
How to use the Guava Cache – from a simple usecase to eviction of elements, refresh and preload of the cache and removal notifications.
Generate Bounded and Unbounded Random Strings using plain Java and the Apache Commons Lang library.
Some interesting discussions this week on microservices and solid testing tactics for working with legacy code.
The many ways to write data to File using Java.
Quick and to the point review this week – a solid JUnit tutorial series, a great article on persistence – specifically on long update operations and one my favorite XKCD series.
The longest weekly review since January – lots of great Java and Spring articles, interesting testing pieces and some good comics.
An interesting Java focused week, as well as a few Spring announcement and a lot of talk around persistence in general and Hibernate in particular.
Learn how to serialize entities using the Gson library.
Spring 4.1 is out this week, along with some cool predictions of the next Java Random and some pragmatic musings about testing and goal setting. A good week all in all.
This week we’re looking at Spring Boot articles, some solid insights into learning and staying relevant as an engineer and of course – XKCD genius.
How to implement a Login Page for a Spring Security app – Localization, Validation and Error handling.
How to deserialize Json with the Gson library – a cookbook with the most common scenarios.
A strong week for the Java/Spring ecosystem – new Java 9 JEPs announced, a REST API being built and some good thoughts on testing.
Solid week with the new RC2 of Spring 4.1, the Chess TDD series final post and a fantastic writeup on what it means to implement microservices as a team.
Learn how to work with forms using Spring MVC – mapping a basic entity, submit, displaying errors.
An interesting week – a Java bug got out and got contained, some cool Spring apps are being build and a quick solution to an interview problem that can fit in a tweet.
How to write out the contents of a Reader to File using plain Java, Guava or Apache Commons IO.
Diverse week full of solid articles on Spring, Java 8, testing, BDD and risk management – a lot of interesting articles in here.
A diverse week with a first look at Spring 4.1, the new Servlet 4 draft spec being proposed and some good thoughts on testing.
Learn how to generate random numbers in Java – both unbounded as well as within a given interval.
This week was packed with value – from 2 very cool Spring Data new features to a few good usecases of Java 8. A very good week.
How to convert a Reader into an InputStream using Java, Guava and the Apache Commons IO library.
How to convert an InputStream to a Reader using Java, Guava and the Apache Commons IO library.
How to convert a Reader into a byte using plain Java, Guava or the Apache Commons IO library.
How to convert a Reader into a String using Java, Guava and the Apache Commons IO library.
Spring Releases galore this week, but also some great Java 8 articles and my favorite podcast recommendation right now.
How to convert a File to a Reader using Java, Guava and the Apache Commons IO library.
How to Convert a Byte Array into a Reader with plain Java, Guava and the Apache Commons IO library.
Simple conversion from String to Reader in plain Java, Guava and Commons IO.
How to open, manage and close connections with the Apache HttpClient 4.
Java modularity is getting some attention this week, along with a very pragmatic alternative to the “Big Rewrite” of a software system – definitely a good week.
How to delete a File in Java using JDK 6, JDK 7 or the Commons IO library.
How to create a File in Java using JDK 6, JDK 7 with NIO or Commons IO.
Spring centric week with some good steps forward for the community – new Spring IO platform, moving to StackOverflow and a few solid webinar recordings.
How to rename or move a file in Java, using JDK6, JDK7, Guava or Apache Commons.
How to write an InputStream to a File – using Java, Guava and the Commons IO library.
How to open an InputStream from a Java File – using plain Java, Guava and the Apache Commons IO library.
How to convert a byte to an InputStream using plain Java or Guava.
How to convert an InputStream to a byte using plain Java, Guava or Commons IO.
How to convert a String to an InputStream using plain Java, Guava or Commons IO.
This has been quite a diverse week – we saw some Spring work on caching and Spring Data and some great testing articles dealing with fixtures and design.
This article discusses an simple yet flexible solution to configuration that is specific to the environment with Spring.
This week we discuss the HTTP/1.1 spec update (5 years in the works), some recordings and upcoming Spring webinars and clean testing.
How to remove all duplicate elements from a List – first with plan Java, then Guava and finally with Java 8 lambdas.
How to remove all nulls from a List using plain Java, Guava, the Commons Collections framework or the new Java 8 lambda support.
An interesting week with quite a mixed sample of solid articles being published – Spring, Java, Hibernate and Testing resources.
A secure Remember Me solution with Spring Security – using a token persisted in the database.
How to convert the values of a Map to an array, List or Set using plain Java.
How to Convert between a List and a Set using plain Java, Guava or Apache Commons Collections.
How to Convert between an Array and a Set Using Plain Java, Guava or Apache Commons Collections.
How to Convert between an Array and a List Using plain Java, Guava or Apache Commons Collections.
An interesting week with some cool Spring Security 4 preview articles and the results of the “Capture the Bitcount” bug bounty.
Introduction to Spring Data JPA with Spring 4 – the Spring config, the DAO, manual and generated queries and transaction management.
How to upload an entity using multipart upload with the HttpClient.
Lots of resources this week about TDD, live testing of external services, design and Java 8 – a solid week.
This week we talk about language and API design nuances, Two-Factor authentication, passwords, and of course testing and TDD.
This week is definitely about testing – TDD, Unit Testing and the new test support in the upcoming Spring Security 4.
Sort with Hibernate 4 using HQL or the Criteria API.
An solid week for both Java and Spring, as well as very good article (and followup) on building a Hypermedia service from the well known FizzBuzz interview problem.
How to Sort in JPA using JQL or the Criteria API.
This week is all about series and Spring, as well as a back and forth about refactoring as waste and a good start for a set of generic acceptance criteria.
The highlights of this week are some great Java 8 usage of lambdas and concurrency improvements, a few helpful Spring posts and a handful of fantastic articles in the “Musings” section.
This week was packed full of Java 8 articles, a few testing gems and some well researched analyses of production issues.
Pagination in Hibernate – using basic HQL, ScrollableResults as well as the more flexible and type-safe Criteria API.
Pagination in JPA – how to use JQL and the Criteria API to do pagination correctly.
This week is all about systems in production – starting with a couple of great articles about making sense of log files, real-time analytics and a pragmatic view on reporting.
The highlights of this week include the second installment of a great TDD video series, a host of Spring releases and webinars, and of course some solid Java 8 resources.
The week when Java 8 came out – a few good Java 8 articles, some resources on Continuous Delivery and TDD that you should not miss, and an exciting HTTP(S) development.
Great week with lots of articles – from TDD, Software Development attitude, the Circuit Breaker pattern (good one to know) and Programmer Podcasts.
The 9h weekly review starts with the usual Spring releases and great webminars, API architecture and testing resources.
The 8th weekly review, going wide from the design of a new Hypermedia type to best practices on Unit Testing, and a slew of Spring releases.
How to do Basic Authentication with the Spring RestTemplate.
Quite some useful articles this week – and a few must reads, if you’re doing any non-trivial development.
Another great set of articles out in the 2nd week of February – covering the whole spectrum – Security, Performance testing, patterns and a few other subjects.
Week 5 review – really good articles on HTTP and REST this week, among other things.
Do Basic Authentication with the HttpClient 4 – simple usecase, preemptive auth and how to manually set the Authorization header.
Some great Spring, Security and REST articles from the 4th week of 2014.
How to set a custom header on one/all requests sent via the HttpClient 4.
Some great Spring, Security and REST articles from the 3rd week of 2014.
My takeaways from the 2nd week of 2014.
Use Jackson to map custom JSON to any java entity graph with full control over the deserialization process.
Control your JSON output with Jackson 2 by using a Custom Serializer.
Interesting articles from week 1 of 2014.
How to convert an InputStream to a String using plain Java, Guava or Commons IO.
How to unmarshall a JSON that contains Unknown Properties using Jackson.
A quick list of the most popular articles from 2013, by number of views.
How to enable POST Redirect with Apache HttpClient.
Stop the Apache HttpClient automatically following redirects – A Day will come when redirects will be followed, but it’s not THIS DAY!
Learn how to process lines in a large file efficiently with Java – no need to store everything in memory.
How to fix the Jackson 2 JsonMappingException (No serializer found for class).
How to send Custom Cookies with the Apache HttpClient.
How to serialize and deserialize an Enum as a JSON Object using Jackson 2.
Get the status code of an HTTP Response with HttpClient.
Create an immutable List from an ArrayList with the JDK, Guava or Apache Commons Collections.
How to parse a JSON String into the Jackson JsonNode Model.
Ignore null fields with Jackson 2 – either globally, per class or even per field.
How to map a JSON Array correctly in a type-safe manner to a Java Collection.
Stop/Abort long running requests with the Apache HttpClient.
Set a custom User-Agent header on the client (or on individual requests) with the Apache HttpClient.
Jackson – Change the name of a field to adhere to a specific JSON format.
Only serialize fields that meet your custom criteria using Jackson 2.
Control your JSON Output – Ignore certain fields directly, by name or by type (with mixins) for Jackson bliss.
How to Partition a List using Guava or Apache Commons Collections.
Setup JPA with Spring – how to set up the EntityManager factory and use the raw JPA APIs.
How to Bootstrap a Web Application with Spring and Java-based Configuration.
HttpClient 4 examples and best practices.
Mockito configure Behavior –
examples, usage and best practices.
examples, usage and best practices.
Guava Predicate and Function examples and usage best practices.
Common Hamcrest matchers helpful when working with Collections and arrays.
Exception Handling for a REST API – illustrate the new Spring recommended approach and earlier solutions.
Guava Ordering Cookbook illustrating code examples and nothing else.
Guava Collections Cookbook illustrating code examples and nothing else.
Tutorial for how to work with properties files and property values in Spring.
How to implement the DAO with JPA in a Spring project.
Hibernate Mapping Exception – Unknown Entity – causes and solutions.
Learn how to expand shortened URLs in Java using the Apache HttpClient.
Example of how to configure the HttpClient with SSL.
How to set up Digest Authentication for the Spring RestTemplate using HttpClient 4.
Set up a HttpSessionListener to track the number of active sessions in a web application.
Cookie Remember Me example with Spring Security.
Versioning a REST API – version identifier in the URI or version media types?
Configure Session Timeout in the web.xml of a Java Servlet web application, and globally for a Tomcat or Jetty Server.
How to set up timeout for an HttpClient – connection and socket timeouts, and a mechanism for hard timeout of ongoing http connections.
How to get the currently logged in user with Spring Security.
Example of how to Redirect to different pages after Login with Spring Security.
Solving the – Unable to locate Spring NamespaceHandler for XML schema namespace – for all namespaces.
Digest Authentication with a Spring MVC project – the XML namespace configuration and several examples of consuming the application with curl.
No bean named ‘springSecurityFilterChain’ is defined – the Problem, the causes and the solutions.
Causes and Solutions for the NoSuchBeanDefinitionException in Spring – “No qualifying bean of type”, “No Bean Named”, Proxied Beans, etc.
Configure Sessions with Spring Security – set up Concurrent Sessions, enable Session Fixation Protection and prevent URLs from containing Session information.
How to Set Up a Custom Authentication Provider with Spring Security and the namespace configuration.
Set up Basic Authentication in Spring – the XML Configuration, the Error Messages, and example of consuming the secured URLs with curl.
A quick and practical guide to dealing with different causes of Spring BeanCreationException
Spring Logout Example – how to configure the logout url, the logout-succcess-url and how to use a custom bean to handle advanced logout scenarios.
The differences between access=”permitAll”, filters=”none”, security=”none” in Spring Security.
Guide on how to set up Maven to use Spring Repositories – Release Candidates, Milestones and Snapshots – after the Spring infrastructure updates.
The Spring DataIntegrityViolationException – Causes and Solutions for Hibernate and JPA: ConstraintViolationException, PropertyValueException, DataException, EntityExistsException.
Spring @RequestMapping – Basic Example, @RequestParam, @PathVariable, Header mapping
Causes and Solutions for the BeanDefinitionStoreException in Spring – FileNotFoundException, NoSuchMethodError, NoClassDefFoundError and IOException.
Maven Release to Nexus – defining the repository in the pom, using the nexus release plugin, and the Release Process breakdown.
Setup Hibernate 3 with Spring – the Java and XML Configuration, integration with MySQL and usage best practices.
A Spring Login Example – How to Set Up a simple Login Form, a Basic Security XML Configuration and some more Advanced Configuration Techniques.
Spring Security with Maven
Maven Deploy to Nexus – The Nexus Snapshot Repository in the pom and how to set up the Deployment Process.
Spring with Maven – focuses on the dependencies for Persistence, Web, Security and Testing.
Install local jar with Maven maven-install-plugin
Multipart Upload on S3 with jclouds custom S3 API – breaking the Content in Parts, Uploading the Parts individually, marking the Upload as complete via the Amazon API.
Upload on S3 with the jclouds library – the 4 generic Blob APIs.
Testing a REST Service with multiple Media Types/representations.
ETags with the Spring – ShallowEtagHeaderFilter, integration testing of the REST API, and consumption scenarios with curl.
Pagination in a Spring REST Service – URI structure and best practice, Page as Resource vs Page as Representation.
The DAO Layer with Spring and Hibernate – focuses on Transaction Management, Hibernate Session management, Spring template best practices and common pitfalls.
How to Set Up and Configure both Basic and Digest Authentication for the same REST Service, using Spring Security.
Implementation of HATEOAS and Discoverability for a Spring REST API.
HATEOAS and Discoverability of a REST Service – driven by tests.
Set up Integration testing with the Maven Cargo and the cargo-maven2-plugin (maven-cargo-plugin).
How to test a REST Service with Java – integration testing using the Apache Http Client.
How to avoid brittle and inflexible tests for the Service Layer of a Spring web app – mock out the interactions with the database, using JUnit, Mockito and Hamcrest.