tumblr counter

Create Thread In Java Web Application

Create Thread In Java Web Application

Create Thread In Java Web Application explains about implementing a background thread in a java web application so that you can do some logic behind these background thread.

You can achive thread implementation in j2ee web application several ways. For example if you are using application servers like Jboss,Weblogic & Websphere, you have more possible ways to do this. But here we are targeting for both servlet containers like Tomcat, jetty etc and application servers like JBOSS, Weblogic etc.

Evaluate/Check List/Collection Is Empty In JSTL

Evaluate/Check List/Collection Is Empty In JSTL

Evaluate/Check List/Collection Is Empty In JSTL explains about How to evaluate whether a List or Collection is empty using JSTL empty operator.

Consider the example here, a JSP page which contains a HashMap with lot of key value pairs in it and we need check this list is empty or not

For evaluating a Collection is empty or not inside JSTL, we can use empty operator. By using this operator we can check Collection is empty or not

Java 8 Encode/Decode base64 Example

Java 8 Encode/Decode base64 Example

Java 8 Encode/Decode base64 Example explains about encoding and decoding of a Base64 string using java 8

I have already wrote an article Encode And Decode In Base64 Using Java before 3 years, about encoding/decoding base64 formatted string using different java third party api's. This is because in that days, there is no decent api is available for encode/decode a string into base64

Finally Java 8 included new feature to encode/decode base64 string without the help of any third party libraries

JoSQL tutorial

JoSQL tutorial

JoSQL (SQL for Java Objects) provides the ability for a developer to apply a SQL statement to a collection of Java Objects. JoSQL provides the ability to search, order and group ANY Java objects and should be applied when you want to perform SQL-like queries on a collection of Java Objects.

As a developer, JoSQL (SQL for Java Objects) helps us to perform sql queries in collection of in-memory java objects.

We can perform following operations using JoSQL

1) where 2) like 3) group by 4) order by 5) limit 6) between

Referenece - > http://josql.sourceforge.net/

JSTL Size Of Map

JSTL Size Of Map

JSTL Size Of Map explains about how to find the size of a map using JSTL Taglib

Consider the example here, a JSP page which contains a HashMap with lot of key value pairs in it and we need to find the size of this HashMap

We already seen how to find the size of a Collection using the JSTL fn:length function.

You can see it fn:length() JSTL Function .

Spring MVC 4 Autowire Example

Spring MVC 4 Autowire Example

Spring MVC 4 Autowire Example shows a real time implementation of autowiring a bean to required service.

Spring @Autowired annotation is used for autowiring a bean to constructor, setter method, property or methods.

Following are the different ways we can do autowire feature

  1. Auto-Wiring "no" -> This is default mode means no autowiring
  2. Auto-Wiring "byName" -> This means autowiring happens using the matching property name
  3. Auto-Wiring "byType" -> This means autowiring happens using the matching type
  4. Auto-Wiring "constructor" -> This means autowiring happens through constructor according to the exact arguments

Spring MVC 4 REST Example

Spring MVC 4 REST Example

Spring MVC 4 REST Example explains about creating a simple Spring MVC REST service using eclipse.

In this example we are using Jackson JSON API for returning JSON response according to the request

Now a days more and more deployment is going based on restful services compare to WSDL Webservices, due to the weights towards the simplicity of configuration

You can see the below example, which is demonstrating How to create a Spring Restful service using MVC 4

Spring MVC 4 Example

Spring MVC 4 Example

Spring MVC 4 Example explains step by step example of configuring Spring MVC with eclipse

Spring version 4.0 provides full support for the latest Java 8 features.

Spring MVC is a popular Java Model-View-Contraller (MVC) framework. Basically spring is request based framework, which revolve around DispatcherServlet that dispatches the requests with the help of different lifecycle interfaces

Spring MVC have following important interfaces to handle a request during the execution phases of a HTTP request.

  • HandlerMapping
  • HandlerAdapter
  • Controller
  • View
  • ViewResolver
  • HandlerInterceptor
  • LocaleResolver
  • MultipartResolver