Share on Google+Share on Google+

Special Bean Types of WebApplicationContext

Special Bean Types of WebApplicationContext

Special Bean Types of WebApplicationContext

In this section, you will learn about Special Bean Types in the WebApplicationContext.

In Spring , special bean types are needed by DispatcherServlet to process the http requests and render the suitable view back to the client. You can configure one or more beans according to your need in the WebApplicationContext. Default beans list is retained by the Spring MVC, in case if it is not configured. This list is kept inside the package org.springframework.web.servlet as file

You can configure special bean type as given below (Here bean type is viewResolver):

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns=""
xmlns:xsi="" xmlns:p=""

	<context:component-scan base-package="net.roseindia.controller" />

	<bean id="viewResolver"
		<property name="viewClass"
		value="org.springframework.web.servlet.view.JstlView" />
		<property name="prefix" value="/WEB-INF/jsp/" />
		<property name="suffix" value=".jsp" />

Complete list of beans type in WebApplicationContext is given below :

Bean Type


HandlerMapping According to some criteria this bean maps oncoming requests to handlers and handler interceptors.
HandlerAdapter Irrespective of the handler is really called, it helps the DispatcherServlet to called a handler mapped to a request.
HandlerExceptionResolver This bean maps exceptions to views and also permitting complex exception handling.
ViewResolver This bean actually resolves view names ,provided as string ,into actual view types.
LocaleResolver This bean resolves the locale of the client.
ThemeResolver This bean resolves the themes which can be utilized by your application.
MultipartResolver This bean parses multi-part requests. For example, file uploading using HTML forms.
FlashMapManager  The input and the output FlashMap is stores and retrieves by this bean to pass on attributes from one request to another generally around a redirect.



Posted on: December 31, 2012 If you enjoyed this post then why not add us on Google+? Add us to your Circles

Share this Tutorial Follow us on Twitter, or add us on Facebook or Google Plus to keep you updated with the recent trends of Java and other open source platforms.

Discuss: Special Bean Types of WebApplicationContext  

Post your Comment

Your Name (*) :
Your Email :
Subject (*):
Your Comment (*):
  Reload Image