Find maximum & minimum element in array (java / example)

Given an array of integers , find out maximum & minimum number in array using linear search. e.g. input array is { 50, 20, 63, 15, 50, 25, 85, 62, 90, 18 } Minimum or smallest element is 15 Maximum or largest element is 90 Algorithm to find maximum & minimum element in array Initialize min with maximum (largest)… Read More »

Logging aspect in RESTful web service using spring aop (log requests/responses)

Logging request & response information is basic requirement of enterprise RESTFul web service. We will create RESTFul web service using Spring. We have already discussed what is aspect oriented programming. What we will discuss in current post? Create RESTFul web service using spring framework. Create REST resource BookingController to book hotel & retrieve booking information POST resource hotel booking… Read More »

What is aspect oriented programming (aop) in spring (examples) ?

Aspect Oriented programming in spring The aspect oriented programming (aop) is very important module of spring framework. As the nomenclature suggests that programming is driven from aspect. In aspect oriented programming we are concerned about the basic, independent logical unit. These logical unit (or concerns) are not part of business application. These logical unit are… Read More »

Create custom thread pool in java without executor framework (example)

Create a thread pool in java without using executor framework. We will use blocking queue to implements a thread pool. 1. What is thread pool in java? Thread pool is collection of threads, which are created to perform certain tasks. Thread creation is costly IO operation. It’s not advisable to create & destroy thread(s) every now… Read More »

Multipart file upload RESTFul web service (Spring MVC/ java/ example)

File upload is very common scenario in today’s web application. In this post, We will discuss about RESTFul web service exposing Multipart file upload resource using spring mvc. Multipart REST Service (“multipart/mixed”  mime): Spring Multipart file upload service capable of consuming different kind of files like pdf, txt, json, zip etc. In Multipart project we will have HomeController… Read More »

Page 30 of 43« First...1020...2829303132...40...Last »