Java ResourceBundleMessageSource解析错误

Java ResourceBundleMessageSource解析错误,java,spring,jsp,Java,Spring,Jsp,我有一个JSP标记文件,它呈现html头并定义我的Javascript/样式表资源 <%@ tag language="java" %> <%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%> <html> <head> <link rel="stylesheet" type="text/css" href="<spring:theme cod

我有一个JSP标记文件,它呈现html头并定义我的Javascript/样式表资源

<%@ tag language="java" %>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>
<html>
<head>
    <link rel="stylesheet" type="text/css" href="<spring:theme code="main.css"/>"/>
    <script type="text/javascript" src="<spring:theme code="default.js"/>"></script>
...

</html>

...
现在我不想为javascript加载i18n消息

var button_ok='<spring:message code="js.button.ok" javaScriptEscape="true"/>';
var按钮\u ok='';
当我在标记文件中使用它时,它会按照假设工作并解析消息,即使只有默认的
messages.properties
(回退)


但是,如果我使用外部javascript文件加载消息,它只会尝试根据当前语言的属性解析消息代码,而回退到默认值则不起作用。

如果消息应该在标记内解析,使用DispatcherServlet中定义的ApplicationContext。否则将使用ContextLoaderListener中的ApplicationContext(根应用程序上下文)


为了解决这个问题,我将ResourceBundleMessageSource移动到由ContextLoaderListener加载的配置中。

很难相信文件名的一部分会产生如此大的差异。您是否检查过问题不属于任何缓存的java脚本?