I am replacing jstl <fmt> with <spring:message> tag in my web application and i m seeing following exception from framework.
Stack Trace:
No WebApplicationContext found: no ContextLoaderListener registered? Start server side stack trace: java.lang.IllegalStateException: No WebApplicationContext found: no ContextLoaderListener registered? at org.springframework.web.servlet.support.RequestCon textUtils.getWebApplicationContext(RequestContextU tils.java:84) at org.springframework.web.servlet.support.RequestCon text.initContext(RequestContext.java:203) at org.springframework.web.servlet.support.JspAwareRe questContext.initContext(JspAwareRequestContext.ja va:74) at org.springframework.web.servlet.support.JspAwareRe questContext.(JspAwareRequestContext.java:48) at org.springframework.web.servlet.tags.RequestContex tAwareTag.doStartTag
I have the following entry in spring config file
<bean id="messageSource" class="org.springframework.context.support.Resourc eBundleMessageSource">
<property name="basename"><value>MessageResource</value></property>
</bean>
Is this configuration enough to use a resource bundle r m i missing anything.
I also dissected the source code and realised that "webapplication context "will be binded only when the request goes thru "Dispatcher Servlet".When the page is directly accessed it is noway can go thru the Dispatcher Servlet.Is there any other way of binding this "application context" so that it can able to find "messageSource" bean declared in "spring-servlet.xml".
Thanks in advance.


Reply With Quote