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 8696621
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T01:18:56+00:00 2026-06-13T01:18:56+00:00

I am trying to build a spring MVC application (basically for self trainning reasons).

  • 0

I am trying to build a spring MVC application (basically for self trainning reasons). This application has spring MVC, tiles, spring thems and jsp (sorry for numbering all but since i am not sure what i do wrong, i just wish to number all i think may help you help me).

my spring mvc configuration seems to work, untill i try to get message property from property files through org.springframework.context.support.ReloadableResourceBundleMessageSource.
so here is my configuration

<bean id="messageSource" class="org.springframework.context.support.ReloadableResourceBundleMessageSource" p:cacheSeconds="3000">
    <property name="basenames">
        <list>
            <value>messages</value>
            <value>dev</value>
            <value>theme</value>
        </list>         
    </property>
</bean>  


<bean id="tilesConfigurer" class="org.springframework.web.servlet.view.tiles2.TilesConfigurer" p:definitions="/WEB-INF/tiles-defs/tiles-defs.xml" />
<bean id="tilesViewResolver" class="org.springframework.web.servlet.view.ResourceBundleViewResolver" p:basename="views" />


<!-- Declare the Interceptor -->
<bean id="localeChangeInterceptor" class="org.springframework.web.servlet.i18n.LocaleChangeInterceptor" p:paramName="language"/>
<bean id="themeChangeInterceptor" class="org.springframework.web.servlet.theme.ThemeChangeInterceptor" p:paramName="theme"/>

<!-- Declare the Resolver -->
<bean id="localeResolver" class="org.springframework.web.servlet.i18n.SessionLocaleResolver"/>
<bean id="themeResolver" class="org.springframework.web.servlet.theme.SessionThemeResolver"/>

<!-- Spring themes -->
<bean class="org.springframework.web.servlet.mvc.support.ControllerClassNameHandlerMapping">
    <property name="interceptors">
        <list>
            <ref local="themeChangeInterceptor" />
            <ref bean="localeChangeInterceptor" />                          
        </list>
    </property>
</bean>

tiles and theme seem to work, so in my tiles baselayout i have:

<title><tiles:insertAttribute name="title" ignore="true" /></title>
    <c:set var="css"><spring:theme code="css"/></c:set>
    <c:if test="${not empty css}">
        <link rel="stylesheet" href="<c:url value='${css}'/>" type="text/css"/>
    </c:if>

this works! html is rendered with the correct css that i have in css property located inside theme.properties file loaded from ReloadableResourceBundleMessageSource and magically existing inside tiles!

So, getting courage i go to my jsp and insert
attempt 1:

 <p><spring:message code="context"/></p>

attempt 2:

<p><fmt:message key="context"/></p>

tags used:

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

(is there a difference? both work? seen both over web… so i tried once the first and then the second one)

and in the messages.properties/messages_el_gr.properties files i type context=default and context=greek.

This gives me exception in the first case and in the second just the string context prefixed and postfixed with ???.
Exception i get is:

SEVERE: Servlet.service() for servlet [dispatcher] in context with path [/homeAutomation] threw exception [Request processing failed; nested exception is org.apache.tiles.impl.CannotRenderException: ServletException including path ‘/WEB-INF/tiles/baseLayout.jsp’.] with root cause
javax.servlet.jsp.JspTagException: No message found under code ‘context’ for locale ‘el_GR’.
at org.springframework.web.servlet.tags.MessageTag.doStartTagInternal(MessageTag.java:184)
at org.springframework.web.servlet.tags.RequestContextAwareTag.doStartTag(RequestContextAwareTag.java:79)
at org.apache.jsp.WEB_002dINF.jsp.friends_jsp._jspx_meth_spring_005fmessage_005f0(friends_jsp.java:104)
at org.apache.jsp.WEB_002dINF.jsp.friends_jsp._jspService(friends_jsp.java:75)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:419)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:333)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:304)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:684)
at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:593)
at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:530)
at org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.java:927)
at org.apache.jasper.runtime.PageContextImpl.doInclude(PageContextImpl.java:684)
at org.apache.jasper.runtime.PageContextImpl.include(PageContextImpl.java:678)
at org.apache.tiles.jsp.context.JspTilesRequestContext.include(JspTilesRequestContext.java:103)
at org.apache.tiles.jsp.context.JspTilesRequestContext.dispatch(JspTilesRequestContext.java:96)
at org.apache.tiles.renderer.impl.TemplateAttributeRenderer.write(TemplateAttributeRenderer.java:44)
at org.apache.tiles.renderer.impl.AbstractBaseAttributeRenderer.render(AbstractBaseAttributeRenderer.java:106)
at org.apache.tiles.renderer.impl.ChainedDelegateAttributeRenderer.write(ChainedDelegateAttributeRenderer.java:76)
at org.apache.tiles.renderer.impl.AbstractBaseAttributeRenderer.render(AbstractBaseAttributeRenderer.java:106)
at org.apache.tiles.impl.BasicTilesContainer.render(BasicTilesContainer.java:670)
at org.apache.tiles.impl.BasicTilesContainer.render(BasicTilesContainer.java:336)
at org.apache.tiles.template.InsertAttributeModel.renderAttribute(InsertAttributeModel.java:210)
at org.apache.tiles.template.InsertAttributeModel.end(InsertAttributeModel.java:126)
at org.apache.tiles.jsp.taglib.InsertAttributeTag.doTag(InsertAttributeTag.java:311)
at org.apache.jsp.WEB_002dINF.tiles.baseLayout_jsp._jspx_meth_tiles_005finsertAttribute_005f3(baseLayout_jsp.java:307)
at org.apache.jsp.WEB_002dINF.tiles.baseLayout_jsp._jspService(baseLayout_jsp.java:108)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:419)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:333)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:304)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:684)
at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:471)
at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:402)
at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:329)
at org.apache.tiles.servlet.context.ServletTilesRequestContext.forward(ServletTilesRequestContext.java:241)
at org.apache.tiles.servlet.context.ServletTilesRequestContext.dispatch(ServletTilesRequestContext.java:222)
at org.apache.tiles.renderer.impl.TemplateAttributeRenderer.write(TemplateAttributeRenderer.java:44)
at org.apache.tiles.renderer.impl.AbstractBaseAttributeRenderer.render(AbstractBaseAttributeRenderer.java:106)
at org.apache.tiles.impl.BasicTilesContainer.render(BasicTilesContainer.java:670)
at org.apache.tiles.impl.BasicTilesContainer.render(BasicTilesContainer.java:690)
at org.apache.tiles.impl.BasicTilesContainer.render(BasicTilesContainer.java:644)
at org.apache.tiles.impl.BasicTilesContainer.render(BasicTilesContainer.java:627)
at org.apache.tiles.impl.BasicTilesContainer.render(BasicTilesContainer.java:321)
at ……

I consider that i do not have the messageSource inside my context, so i considered as next step of searching what is going on to do the following (found on web)

@Autowired
ReloadableResourceBundleMessageSource messageSource;
@RequestMapping("/friends.htm")
public ModelAndView getPage()
{   
    ModelAndView modelAndView=new ModelAndView("friends");
    modelAndView.addObject(messageSource);
    return modelAndView;
}

by the way, my previeus controller had that method as follows:

@RequestMapping("/friends.htm")
public String getPage()
{   
    return friends;
}

This again throws same exception.. messageSource is not null.. it is autowired.
if i do inside the controller:messageSource.getMessage(“context”, null, Locale.ENGLISH), this throws the same exception when trying to get it.. (Greek locale does not exist?? with english it will go to default locale properties file which is messages.properties, correct?)

Ah, what else can i give you… yes property files are located in the src/main/resources directory and in war inside homeAutomation.war\WEB-INF\classes\ and homeAutomation.war (why?? i thought these would exist only in homeautomation.war directory… but skip this, atleast they are there…) my poms war plugin configuration is as follows:

<plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-war-plugin</artifactId>
            <version>2.1.1</version>
            <configuration>
                <webResources>
                    <resource>
                        <directory>src/main/resources</directory>
                    </resource>
                </webResources>
            </configuration>
        </plugin>

in target directory again i see the property files in both target\classes directory and target\homeAutomation.

After all these, i still do not know what i do wrong and i cannot get localized properties inside my jsp working. I hope i gave al the necessary info (sorry for the too much info…, did not know which was relevant and which not). If you need more info please ask. Have been searching for this five days now and still have no clue.

  • 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-06-13T01:18:58+00:00Added an answer on June 13, 2026 at 1:18 am

    you can use <p><spring:message code="context"/></p>
    but you should have context= what you want in one of the following files :

    • messages_el_GR.properties
    • dev_el_GR.properties
    • theme_el_GR.properties
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying build my application using REST and Spring MVC. For some entities I
I'm having a frustrating time with Spring 3 MVC trying to build RESTful web
I am trying to build an MVC application in Java Swing. I have a
I am trying to implement a MVC application that has a view, controller and
I am new to spring. I am trying to use spring mvc to build
We are trying to build some RESTful services with Spring MVC. We will be
I am trying to build an HtmlHelper extension in ASP.NET MVC RC2. This code
I'm trying to use spring-test-mvc for testing a controller in my little application. Since
I have Roo-generated Spring MVC application connected to PostgreSQL using Hibernate. I am trying
I am trying to use spring mvc to build web app. Before I was

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.