【问题标题】:Theme 'theme': No message found under code 'styleSheet' for locale 'en_US'主题“主题”:在区域设置“en_US”的代码“styleSheet”下未找到消息
【发布时间】:2018-03-29 20:49:49
【问题描述】:

错误: 主题“主题”:在区域设置“en_US”的代码“styleSheet”下找不到消息。

此错误仅发生在欢迎页面(根)上: 当我使用此链接时:

localhost:8080/SpringMVC/

在其他页面上,不会出现此错误 例如:

localhost:8080/SpringMVC/index
localhost:8080/SpringMVC/main
localhost:8080/SpringMVC/user/mike

如果我从头jsp中删除代码,那么这个错误就会消失

代码:

<link rel="stylesheet" href="<spring:theme code='styleSheet'/>" type="text/css"/>

【问题讨论】:

    标签: spring model-view-controller


    【解决方案1】:

    我在 spring 文档中找到了答案: link

    我在以下代码(文本)中添加了一个附加参数:

    <link rel="stylesheet" href="<spring:theme code='styleSheet'/>" type="text/css"/>
    

    改动后:

    <link rel="stylesheet" href="<spring:theme code='styleSheet' text=''/>" type="text/css"/>
    

    现在,如果找不到 code='styleSheet',它将使用“text”字段中的值。

    这个问题只出现在根页面,所以我不知道是否有更好的方法来解决它,但对我来说没问题。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2017-07-25
      • 2017-11-11
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2023-04-04
      • 1970-01-01
      相关资源
      最近更新 更多