SpringMVC Classroom image

Anil  Bist / Professional / Web Technology
 
To post your Question Join Classroom
 
Lesson Topics's No:-  ||
Lessons:-Spring MVC Configuration Concepts

Spring MVC Configuration Concepts

In this section, we will review some core concepts related to configuring the Spring Web MVC Framework.

DispatcherServlet
DispatcherServlet (part of the org.springframework.web.servlet package) is the entry point to the world of Spring Web MVC, as depicted in Figure 7.2. It essentially dispatches requests to the controllers. If you have worked with Java web applications before, you will not be surprised to find out that this class is configured in the web.xml file, as shown in the following excerpt from the complete web.xml for Time Expression:

<servlet-class>
org.springframework.web.servlet.DispatcherServlet
</servlet-class>

We will discuss DispatcherServlet in detail later in this chapter.

Handler Mappings

You can map handlers for incoming HTTP requests in the Spring application context file.These handlers are typically controllers that are mapped to partial or complete URLs of incoming requests.The handler mappings can also contain optional interceptors, which are invoked before and after the handler.This is a powerful concept. I will demonstrate an example of this later in this chapter when we use such a web interceptor for authentication and close our Hibernate session for the given HTTP request.

The following code excerpt taken from our complete timex-servlet.xml file shows how a handler can be mapped to a partial URL:

<bean id=”urlMap”
class=”org.springframework.web.servlet.handler.SimpleUrlHandlerMapping”>
<property name=”urlMap”>
<props>
<prop key=”/signin.htm”>signInController</prop>
<prop key=”/signout.htm”>signOutController</prop>
</props>
</property>
</bean>

View Resolvers

Spring uses the notion of view resolvers, which resolve view names to the actual views (enterhours to enterhours.jsp, for example).We will use Spring’s InternalResourceViewResolver class to resolve our view names. (This is covered in the next section.)

 
 
 
image
Anil  Bist

Skills    SpringMVC

Qualifications :- High School - SLV, College/University - Graphic Era Deemed Univ University,
Location :-Dehradun,Dehradun,Uttarakhand,India
Description:-

in 2006, i Join a web development company in Bangalore and start work on "Ruby on Rail" this is my first web development framework and we worked in this framework and develop four to five project after some time , I moved to JEE/Sturst frame work,

After some time i decided that now times come and I have to go on in my own way and I started a company name is "Soarlogic&q
Explore

 

  Students (0)