java_programmer 0 Junior Poster

I am writing a tiny program to learn Spring framework.
My application will just print a message which is binded with the view in the server side.

My jsp is as follows :

<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

<html>
    <body>
	   <p>This is my message : ${message}</p>
    </body>
</html>

and the java code snippet is

public ModelAndView handleRequest(HttpServletRequest request,
	HttpServletResponse response) throws ServletException, IOException {
	String aMessage = "Hello World MVC my messages!";
	ModelAndView modelAndView = new ModelAndView("hello_world");
         modelAndView.addObject("message", aMessage);
	return modelAndView;
}

And the spring servlet.xml is as follows -

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans" 
	   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
	   xsi:schemaLocation="http://www.springframework.org/schema/beans     http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">
 
	<bean name="/hello_world.html" class="springmvc.web.HelloWorldController"/>
    
	<bean id="viewResolver"  
             class="org.springframework.web.servlet.view.InternalResourceViewResolver">
		<property name="viewClass"  
                            value="org.springframework.web.servlet.view.JstlView"/>
		<property name="prefix" value="/jsp/"/>
		<property name="suffix" value=".jsp"/>
	</bean>
	<bean id="messageSource" 
               class="org.springframework.context.support.ResourceBundleMessageSource">
        <property name="basenames">
            <list>
                <value>messages</value>
            </list>
        </property>
    </bean>

But when I am trying to get the page, the message is not displayed.
The output is This is my message :
Any suggesion is appreciated...
Thanks in advance...

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.