gpt4 book ai didi

java - 找不到 Struts 2 模板

转载 作者:行者123 更新时间:2023-12-02 04:56:48 25 4
gpt4 key购买 nike

我为 Struts 2 创建了一个新的主题模板。

所以我将以下代码放入我的 struts.xml 中:

<constant name="struts.ui.theme" value="mynew" />

这个模板目录在哪里,以便我可以将新主题放入其中。我尝试了很多位置,但没有一个有效。

java.io.FileNotFoundException: Template /template/mynew/actionerror.ftl not found.

最佳答案

Struts 2 首先会在 webroot/template/theme 名称中查找标签的模板。如果在那里找不到模板,它将使用默认模板,该模板是 Struts 2 核心 jar 的一部分。您可以在 Template Loading 中了解有关此功能的更多信息。 .

Template directory can be selected using several different rules, in this order:

  • The templateDir attribute on the specific tag
  • The page-scoped attribute named templateDir
  • The request-scoped attribute named templateDir
  • The session-scoped attribute named templateDir
  • The application-scoped attribute named templateDir
  • The struts.ui.templateDir property in struts.properties (defaults to template)

关于java - 找不到 Struts 2 模板,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12986566/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com