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

  • SEARCH
  • Home
  • 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 4088284
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T18:57:45+00:00 2026-05-20T18:57:45+00:00

I’m starting with Spring Web MVC. I have very simple controller and view, but

  • 0

I’m starting with Spring Web MVC. I have very simple controller and view, but when i open page
http://localhost:8080/springonly/spring/hello i get: ${message}, not Hello World

Anybody know what is wrong with that ? Why $-expression have not been recognized ?

View – hello.jsp:

${message}

Controller – HelloController.java:

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

@Controller
public class HelloController {

    @RequestMapping("/hello")
    public ModelAndView hello(HttpServletRequest request,
            HttpServletResponse response) throws Exception {
        return new ModelAndView("hello", "message", "Hello World");
    }

}

web.xml:

<web-app>
    <display-name>Spring Only WebApp</display-name>

    <servlet>
        <servlet-name>springonly</servlet-name>
        <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
        <init-param>
            <param-name>contextConfigLocation</param-name>
            <param-value>/WEB-INF/config/applicationContext.xml</param-value>
        </init-param>
        <load-on-startup>1</load-on-startup>
    </servlet>

    <servlet-mapping>
        <servlet-name>springonly</servlet-name>
        <url-pattern>/spring/*</url-pattern>
    </servlet-mapping>

</web-app>

applicationContext.xml:

<!-- scan for Controllers -->
<context:component-scan base-package="net.marioosh.spring.springonly" />

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

log say:

2011-03-15 13:43:12,703 DEBUG [DispatcherServlet:693] : DispatcherServlet with name 'springonly' processing GET request for [/springonly/spring/hello]
2011-03-15 13:43:12,718 DEBUG [DefaultAnnotationHandlerMapping:221] : Mapping [/hello] to HandlerExecutionChain with handler [net.marioosh.spring.springonly.HelloController@120b2da] and 1 interceptor
2011-03-15 13:43:12,718 DEBUG [DispatcherServlet:769] : Last-Modified value for [/springonly/spring/hello] is: -1
2011-03-15 13:43:12,718 DEBUG [HandlerMethodInvoker:173] : Invoking request handler method: public org.springframework.web.servlet.ModelAndView net.marioosh.spring.springonly.HelloController.hello(javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpServletResponse) throws java.lang.Exception
2011-03-15 13:43:12,718 DEBUG [DispatcherServlet:1045] : Rendering view [org.springframework.web.servlet.view.JstlView: name 'hello'; URL [/WEB-INF/pages/hello.jsp]] in DispatcherServlet with name 'springonly'
2011-03-15 13:43:12,718 DEBUG [JstlView:328] : Added model object 'message' of type [java.lang.String] to request in view with name 'hello'
2011-03-15 13:43:12,718 DEBUG [JstlView:236] : Forwarding to resource [/WEB-INF/pages/hello.jsp] in InternalResourceView 'hello'
2011-03-15 13:43:12,718 DEBUG [DispatcherServlet:674] : Successfully completed request
  • 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-20T18:57:46+00:00Added an answer on May 20, 2026 at 6:57 pm

    Your web.xml is missing the correct header, it should be something like:

    <web-app 
        xmlns="http://java.sun.com/xml/ns/j2ee" 
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" 
        version="2.4"> 
    

    If you leave that out, and just have a bare <web-app>, the container will default to an old, pre-EL version of JSP.

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

Sidebar

Related Questions

Seemingly simple, but I cannot find anything relevant on the web. What is the
I have an MVC Razor view @{ ViewBag.Title = Index; var c = (char)146;
I would like my Web page http://www.gmarks.org/math_in_e-mail.txt on my Apache 2.2.14 server to display
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I have a French site that I want to parse, but am running into
I have a view passing on information from a database: def serve_article(request, id): served_article
I'm making a simple page using Google Maps API 3. My first. One marker

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.