applicationContext.xml配置messages

shadow55 2009-07-30 11:58:59
在web.xml下用

<context-param>
<param-name>javax.servlet.jsp.jstl.fmt.localizationContext</param-name>
<param-value>messages</param-value>
</context-param>

此时调用<fmt:message key="user.userName" />能正常显示,但是用spring来加载:

<bean id="messageSource"
class="org.springframework.context.support.ResourceBundleMessageSource">
<property name="basename">
<value>messages</value>
</property>
</bean>

页面上<fmt:message key="user.userName"/>总显示 ???user.userName???,说明找不到资源文件,是什么原因啊?
...全文
76 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
shadow55 2009-07-31
  • 打赏
  • 举报
回复
up一下,顺便贴上我的web.xml的配置

<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/springconfig/*.xml</param-value>
</context-param>

<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
xinchi21cool 2009-07-31
  • 打赏
  • 举报
回复
跳,问题都不清楚怎么搞????

81,092

社区成员

发帖
与我相关
我的任务
社区描述
Java Web 开发
社区管理员
  • Web 开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧