Spring DispatcherServlet – How does it work?
In this tutorial, we will learn about Spring’s DispatcherServlet class, it’s responsibilities and how to configure it with examples.
In this tutorial, we will learn about Spring’s DispatcherServlet class, it’s responsibilities and how to configure it with examples.
In Spring MVC and Hibernate configuration example, learn to create form-based CRUD application that validates and persists data into database.
In this spring boot example, learn to configure web application to run on SSL (HTTPS) with self-signed certificate. Also learn to create SSL cert, as well.
Learn to get the Stream of random numbers in Java using the Random and SecureRandom methods ints(), longs() and doubles().
In this Java AIML tutorial, we will learn to create demo chatbot application using AIML and NLP application program-ab hosted on google-code repository.
Learn to find min and max date, number, Char, String or object from a stream of items in easy steps using Comparator.comparing().
My requirement was to read the HTTP request body 2 times in servlet filter and the pass the request to filter chain. HttpServletRequestWrapper helped me.
To count the number of elements in stream in Java 8, use either the Stream.count() or Collectors.counting() methods.
To convert primitives intstream or longstream to List, Set or Array, you can adapt one of the following ways given with examples.
In java 8, to convert a stream of primitives to collection, you must first box the elements in their wrapper class and then collect them i.e. boxed stream.
Zipkin is a very efficient tool for distributed tracing in the microservices ecosystem. Distributed tracing, in general, is the latency measurement of each component in a distributed transaction where multiple microservices are invoked to serve a single business usecase. Let’s say from our application, we have to call 4 different …
In this ELK tutorial, learn to integrate ELK stack in microservice ecosystem for distributed logs management and processing, and viewing logs in UI Console.
Spring 5 is the first major release, almost four years after Spring Framework 4.0. Lets quickly go through some exciting features coming in Spring 5.0.
Learn to install a Docker on Windows, create a Docker image for Spring Boot application and deploy the Dockerized image in the developer machine.
Java 9 is bringing lots of new enhancements which are going to affect your programming style and habit, in big way. The biggest change is the modularization of Java. It’s another big change after Lambdas in Java 8. In this article, I am listing down changes which will be part …
JPMS (Java Platform Module System) is the major enhancement in Java 9. It is also known as Project Jigsaw. In this Java 9 modules tutorial, we will learn about modules (in general) and how your programming style will change in future when you will start writing modular code.
Learn about service virtualization concepts in detail and also look into a popular and useful service virtualization tool – Hoverfly. Also see how Hoverfly can be used to capture request/responses in proxy mode and use those captured responses while Hoverfly will run in simulation mode.
Dozer bean mapping example. Learn dozer for mapping nested object, use Spring bean mapping builder, dozer custom converters to copy data between beans.
Today along with Microservices, another concept is very popular that is Serverless architecture. Serverless refers to the cloud deployment model with elasticity where you deploy your code/services to 3rd party cloud providers (e.g. AWS) instead of managing servers and platform manually. Cloud provider provides all infrastructure and platform support where …
JShell allows us to execute Java code snippets and get immediate results without having to create a solution or project or using any code editor.
Date and time handling has always been a pain area for Java developers. The new Date-Time API added in Java 8 changed the way, we interact with date and time in Java. New Date API is a very powerful and much-needed improvement. The only thing missing was, getting a stream …
Lombok is very handy tool for minimizing the boilerplate code as well as providing lot’s of other features such as lazy loading, thread safety or immutability. This is the reason it becoming very popular among the developer community.
Learn new Java 9 improvements in Stream API, i.e., the takeWhile / dropWhile, ofNullable, and iterate methods with examples.
Learn to create immutable collections such as immutable list, immutable set and immutable map using new factory methods in Java 9.
Java 9 onward, you are allowed to include private methods in interfaces. Using private methods, now encapsulation is possible in interfaces as well. In this java 9 tutorial, we will learn about interface private methods in detail. Table of Contents Interfaces till Java 7 Static and defaults methods since Java …
Netflix zuul example using zuul API gateway pattern. Learn to create load balancer using Netflix Zuul and its solid bonding with Spring Cloud.
Learn to create Microservices, based on Spring cloud, registering on HashiCorp Consul registry server and how other microservices (discovery clients) use it to register and discover services to call their APIs.
Learn to leverage the one of the Spring cloud Netflix stack component called Hystrix to implement circuit breaker while invoking underlying microservice. It is generally required to enable fault tolerance in the application where some underlying service is down/throwing error permanently, we need to fall back to different path of …
Learn to create JAX-RS 2.0 REST APIs using Spring Boot and Jersey framework, and add role based security using JAX-RS annotations e.g. @PermitAll, @RolesAllowed or @DenyAll. Table of Contents Project Structure Create REST APIs Secure REST APIs with JAX-RS Annotations Write security filter using JAX-RS ContainerRequestFilter Demo Project Structure The …
Now a days REST and Microservices have got a lot of momentum. At the same time, actual REST specification does not suggest any standard way to document the REST APIs that we are going to expose [like WSDL for SOAP]. As a result, everybody is documenting their APIs in their …
Learn about Amazon S3 (Simple Storage Service), creating a bucket in AWS S3 and then hosting a static website or static contents in the storage area.
Learn to configure and create JAX-RS 2.0 REST APIs using Spring Boot and Jersey framework. This example application uses Jersey’s ServletContainer to deploy the REST APIs.
Learn to deploy and host spring boot applications into Pivotal Cloud Foundry Web Services Platform (PWS) and access REST endpoint from local workstation.
Learn to create microservice, based on Spring cloud, which act as Netflix Eureka registry server and how other microservices (Eureka clients) use it to register and discover services.
Config server is where all configurable parameters of microservices are written are maintained. It is more like externalizing properties / resource file out of project codebase to an external service altogether, so that any changes to that property does not necessitate the deployment of service which is using the property. All such property changes will be reflected without redeploying the microservice.
Learn to install python package in sublime editor for features like autocomplete and run build within sublime editor itself.
Static keyword in java can be applied on variables, methods, blocks, import and inner classes. Learn the effect of using static keyword in detail.
Learn to create maven custom archetypes which helps in creating a specific type of project structure which is not available in any standard maven archetype.
Command pattern is a behavioral design pattern which is useful to abstract business logic into discrete actions i.e. commands. It motivates loose coupling.
Java constructors are special method-like constructs that allow fully initializing the object state before other classes can use it.
Java Inheritance refers to the ability of a child class to inherit all the non-private properties and methods from the parent class.
In this Lucene 6 tutorial, we will learn to use RAMDirectory to run quick examples of POCs because it is not intended to work with huge indexes.
In Lucene, WildcardQuery can be used to execute wildcard based searches on lucene indexes. Learn to use WildcardQuery with example.
Lucene UnifiedHighlighter is the highest-performing highlighter, especially for large documents. Tutorial to highlight search terms in indexed documents/files.
In Lucene highlighter example, learn to search in documents and highlight search terms in search results using SimpleHTMLFormatter and Fragmenter.
In Lucene 9 example, learn to create indexes from unstructured text files and then search tokens within indexed documents with respective scores of documents.
Learn to compile regular expression into java.util.function.Predicate. This can be useful when you want to perform some operation on matched tokens.
Strategy design pattern is behavioral design pattern where we choose a specific implementation of algorithm or task in run time – out of multiple other implementations for same task.
Learn to use Lucene 6 to create, index and search documents using code examples to read, write lucene documents and performing search over them.
HowToDoInJava provides tutorials and how-to guides on Java and related technologies.
It also shares the best practices, algorithms & solutions and frequently asked interview questions.