Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7444573
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T11:32:32+00:00 2026-05-29T11:32:32+00:00

I have read this tutorial to write my hello world application with spring mvc.But

  • 0

I have read this tutorial to write my hello world application with spring mvc.But I cant see ${message} in hello.jsp when I click on “Say Hello” link in index.jsp. My code actually is same with code in tutorial. I am new in Spring and I can’t find where I did mistake please help me.

HelloWorldController.java

package controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

@Controller
public class HelloWorldController {

    @RequestMapping("/hello")
    public ModelAndView helloWorld() {

        String message = "Hello World, Spring 3.0!";
        return new ModelAndView("hello", "message", message);
    }
}

Web.xml

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" id="WebApp_ID" version="3.0">
  <display-name>springmvcben</display-name>
  <welcome-file-list>
    <welcome-file>index.jsp</welcome-file>
  </welcome-file-list>
  <servlet>
    <servlet-name>spring</servlet-name>
    <servlet-class>
            org.springframework.web.servlet.DispatcherServlet
        </servlet-class>
    <load-on-startup>1</load-on-startup>
  </servlet>
  <servlet-mapping>
    <servlet-name>spring</servlet-name>
    <url-pattern>*.html</url-pattern>
  </servlet-mapping>
</web-app>

spring-servlet.xml

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:p="http://www.springframework.org/schema/p"
    xmlns:context="http://www.springframework.org/schema/context"
    xsi:schemaLocation="http://www.springframework.org/schema/beans

http://www.springframework.org/schema/beans/spring-beans-3.0.xsd

http://www.springframework.org/schema/context

http://www.springframework.org/schema/context/spring-context-3.0.xsd">

    <context:component-scan base-package="controller" />
    <bean id="viewResolver"
        class="org.springframework.web.servlet.view.UrlBasedViewResolver">
        <property name="viewClass"
            value="org.springframework.web.servlet.view.JstlView" />
        <property name="prefix" value="/WEB-INF/" />
        <property name="suffix" value=".jsp" />
    </bean>
</beans>

hello.jsp

<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
</head>
<body>
This is message:
 ${message}
</body>
</html>

index.jsp

<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
</head>
<body>
<a href="hello.jsp">Say Hello</a>
</body>
</html>

This my project structure:
enter image description here

And this is my output

?ub 09, 2012 1:37:21 AM org.apache.catalina.core.AprLifecycleListener init INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\Program Files\Java\jre7\bin;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:/Program Files/Java/jre7/bin/client;C:/Program Files/Java/jre7/bin;C:/Program Files/Java/jre7/lib/i386;c:\program files\common files\microsoft shared\windows live;c:\program files\nvidia corporation\physx\common;C:\Windows\system32;C:\Windows;C:\Windows\system32\wbem;C:\Windows\system32\windowspowershell\v1.0\;c:\program files\microsoft sql server\100\tools\binn\;c:\program files\microsoft sql server\100\dts\binn\;c:\program files\windows live\shared;c:\program files\ibm\gsk8\lib;C:\db2\BIN;C:\db2\FUNCTION;C:\db2\SAMPLES\REPL;C:\Program Files\QuickTime\QTSystem\;C:\Users\Ferid\Desktop\eclipse-jee-indigo-SR1-win32\eclipse;;. ?ub 09, 2012 1:37:22 AM org.apache.tomcat.util.digester.SetPropertiesRule begin WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:springmvcben' did not find a matching property. ?ub 09, 2012 1:37:22 AM org.apache.coyote.AbstractProtocol init INFO: Initializing ProtocolHandler ["http-bio-8080"] ?ub 09, 2012 1:37:22 AM org.apache.coyote.AbstractProtocol init INFO: Initializing ProtocolHandler ["ajp-bio-8009"] ?ub 09, 2012 1:37:22 AM org.apache.catalina.startup.Catalina load INFO: Initialization processed in 520 ms ?ub 09, 2012 1:37:22 AM org.apache.catalina.core.StandardService startInternal INFO: Starting service Catalina ?ub 09, 2012 1:37:22 AM org.apache.catalina.core.StandardEngine startInternal INFO: Starting Servlet Engine: Apache Tomcat/7.0.25 ?ub 09, 2012 1:37:26 AM org.apache.catalina.core.StandardContext checkUnusualURLPattern INFO: Suspicious url pattern: "*.*" in context [/springmvcben] - see section SRV.11.2 of the Servlet specification log4j:WARN No appenders could be found for logger (org.springframework.web.servlet.DispatcherServlet). log4j:WARN Please initialize the log4j system properly. ?ub 09, 2012 1:37:26 AM org.apache.catalina.core.ApplicationContext log INFO: Initializing Spring FrameworkServlet 'spring' ?ub 09, 2012 1:37:27 AM org.apache.catalina.startup.HostConfig deployWAR INFO: Deploying web application archive C:\tomcat\apache-tomcat-7.0.25-windows-x86\apache-tomcat-7.0.25\webapps\MerhabaDunya.war ?ub 09, 2012 1:37:27 AM org.apache.catalina.startup.HostConfig deployDirectory INFO: Deploying web application directory C:\tomcat\apache-tomcat-7.0.25-windows-x86\apache-tomcat-7.0.25\webapps\docs ?ub 09, 2012 1:37:27 AM org.apache.catalina.startup.HostConfig deployDirectory INFO: Deploying web application directory C:\tomcat\apache-tomcat-7.0.25-windows-x86\apache-tomcat-7.0.25\webapps\examples ?ub 09, 2012 1:37:28 AM org.apache.catalina.startup.TaglibUriRule body INFO: TLD skipped. URI: http://java.sun.com/jstl/core is already defined ?ub 09, 2012 1:37:28 AM org.apache.catalina.startup.TaglibUriRule body INFO: TLD skipped. URI: http://java.sun.com/jstl/sql_rt is already defined ?ub 09, 2012 1:37:28 AM org.apache.catalina.startup.TaglibUriRule body INFO: TLD skipped. URI: http://java.sun.com/jsp/jstl/sql is already defined ?ub 09, 2012 1:37:28 AM org.apache.catalina.startup.TaglibUriRule body INFO: TLD skipped. URI: http://java.sun.com/jstl/core_rt is already defined ?ub 09, 2012 1:37:28 AM org.apache.catalina.startup.TaglibUriRule body INFO: TLD skipped. URI: http://java.sun.com/jsp/jstl/core is already defined ?ub 09, 2012 1:37:28 AM org.apache.catalina.startup.TaglibUriRule body INFO: TLD skipped. URI: http://java.sun.com/jsp/jstl/functions is already defined ?ub 09, 2012 1:37:28 AM org.apache.catalina.startup.TaglibUriRule body INFO: TLD skipped. URI: http://java.sun.com/jstl/fmt is already defined ?ub 09, 2012 1:37:28 AM org.apache.catalina.startup.TaglibUriRule body INFO: TLD skipped. URI: http://jakarta.apache.org/taglibs/standard/permittedTaglibs is already defined ?ub 09, 2012 1:37:28 AM org.apache.catalina.startup.TaglibUriRule body INFO: TLD skipped. URI: http://java.sun.com/jstl/xml is already defined ?ub 09, 2012 1:37:28 AM org.apache.catalina.startup.TaglibUriRule body INFO: TLD skipped. URI: http://jakarta.apache.org/taglibs/standard/scriptfree is already defined ?ub 09, 2012 1:37:28 AM org.apache.catalina.startup.TaglibUriRule body INFO: TLD skipped. URI: http://java.sun.com/jstl/fmt_rt is already defined ?ub 09, 2012 1:37:28 AM org.apache.catalina.startup.TaglibUriRule body INFO: TLD skipped. URI: http://java.sun.com/jsp/jstl/fmt is already defined ?ub 09, 2012 1:37:28 AM org.apache.catalina.startup.TaglibUriRule body INFO: TLD skipped. URI: http://java.sun.com/jsp/jstl/xml is already defined ?ub 09, 2012 1:37:28 AM org.apache.catalina.startup.TaglibUriRule body INFO: TLD skipped. URI: http://java.sun.com/jstl/xml_rt is already defined ?ub 09, 2012 1:37:28 AM org.apache.catalina.startup.TaglibUriRule body INFO: TLD skipped. URI: http://java.sun.com/jstl/sql is already defined ?ub 09, 2012 1:37:28 AM org.apache.catalina.core.ApplicationContext log INFO: ContextListener: contextInitialized() ?ub 09, 2012 1:37:28 AM org.apache.catalina.core.ApplicationContext log INFO: SessionListener: contextInitialized() ?ub 09, 2012 1:37:28 AM org.apache.catalina.core.ApplicationContext log INFO: ContextListener: attributeAdded('org.apache.jasper.compiler.TldLocationsCache', 'org.apache.jasper.compiler.TldLocationsCache@1be0de') ?ub 09, 2012 1:37:28 AM org.apache.catalina.startup.HostConfig deployDirectory INFO: Deploying web application directory C:\tomcat\apache-tomcat-7.0.25-windows-x86\apache-tomcat-7.0.25\webapps\host-manager ?ub 09, 2012 1:37:28 AM org.apache.catalina.startup.HostConfig deployDirectory INFO: Deploying web application directory C:\tomcat\apache-tomcat-7.0.25-windows-x86\apache-tomcat-7.0.25\webapps\manager ?ub 09, 2012 1:37:28 AM org.apache.catalina.startup.HostConfig deployDirectory INFO: Deploying web application directory C:\tomcat\apache-tomcat-7.0.25-windows-x86\apache-tomcat-7.0.25\webapps\ROOT ?ub 09, 2012 1:37:28 AM org.apache.coyote.AbstractProtocol start INFO: Starting ProtocolHandler ["http-bio-8080"] ?ub 09, 2012 1:37:28 AM org.apache.coyote.AbstractProtocol start INFO: Starting ProtocolHandler ["ajp-bio-8009"] ?ub 09, 2012 1:37:28 AM org.apache.catalina.startup.Catalina start INFO: Server startup in 6007 ms

Please help me to solve this problem.

enter image description here

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T11:32:34+00:00Added an answer on May 29, 2026 at 11:32 am

    I might be mistaken, but the DispatcherServlet mapping is pointing elsewhere – it is in fact mapped to *.html, while you are requesting hello.jsp – this skips the dispatcher servlet and goes straight to the JSP page. In addition, your JstlView is configured to fetch JSPs from the WEB-INF folder.

    Try moving hello.jsp in the WEB-INF folder and then invoking /hello.html instead.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have read this question but it's not quite what I was looking for.
I have read this post about how to test private methods. I usually do
I have read this article from High Scalability about Stack Overflow and other large
I have read this article about 400% boost of your website . This is
I have read this. Jquery checkbox <input type=checkbox name=checkGroup id=all> <input type=checkbox name=checkGroup id=one
First let me say I have read this useful article thoroughly and am using
I have read over this which sort of gives an explanation of when you'd
Possible Duplicate: What’s with the love of dynamic Languages I have already read this
I have read the documentation on this and I think I understand. An AutoResetEvent
I have read some posts about this topic and the answers are comet, reverse

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.