JMX and MBeans with Spring

by Prasanth Gullapalli

JMX defines an architecture for management and monitoring of long running Java applications. Simply put, it provides an interface for interacting with a running application. So through JMX, we can check/change the state of variables or to invoke a method in a (remote) running application via a management GUI such as JConsole. Continue reading


Type Conversion in Spring

by Prasanth Gullapalli

Here are few straight cases where we need type conversion:
Case #1. To help simplifying bean configurations, Spring supports conversion of property values to and from text values. Each property editor is designed for a property of certain type only. And to put them in use, we have to register them with Spring container.
Case #2. Also when using Spring MVC, controllers binds the form field values to properties of an object. Suppose the object is composed with another object, then the MVC controller cannot automatically assign values to the internal custom type object as all the values in the form are inputted as text values. Spring container will take of conversion of text values to primitive types but not to custom type objects. For this to be taken care, we have to initialize custom editors in the MVC flow.

This article will discuss the various ways of implementing the converters for custom type objects. Continue reading