当前位置: 首页 > 知识库问答 >
问题:

带有Thymeleaf配置问题的Spring 3

宗烨赫
2023-03-14
<?xml version="1.0" encoding="UTF-8"?><br>
<beans xmlns="http://www.springframework.org/schema/beans"
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xmlns:context="http://www.springframework.org/schema/context"
     xmlns:mvc="http://www.springframework.org/schema/mvc"
     xsi:schemaLocation="
      http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
      http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.1.xsd
      http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.1.xsd">

    <context:component-scan base-package="web.controller" />

    <!-- Enabling Spring MVC configuration through annotations -->
    <mvc:annotation-driven />

    <!--  Mapping Static Resources -->
    <mvc:resources mapping="/resources/**" location="/resources/" />

    <bean id="templateResolver" class="org.thymeleaf.templateresolver.ServletContextTemplateResolver">
        <property name="prefix" value="/WEB-INF/views/" />
        <property name="suffix" value=".html" />
        <property name="templateMode" value="HTML5" />
    </bean>

    <bean id="templateEngine" class="org.thymeleaf.spring3.SpringTemplateEngine">
        <property name="templateResolver" ref="templateResolver" />
    </bean>

    <bean class="org.thymeleaf.spring3.view.ThymeleafViewResolver">
        <property name="templateEngine" ref="templateEngine" />
        <property name="order" value="1" />
        <property name="viewNames" value="*.html" />
    </bean>

</beans>

共有1个答案

孟成化
2023-03-14

你错过了真正的沉香酒罐。您包含了提供集成的Spring jar,但您忽略了它的实际实现。

从这里下载jar

thymeleaf下载站点

 类似资料:
  • 我正试图解决一个用Spring Boot(Thymeleaf)制作的项目的问题。当我运行项目(作为Spring Boot应用程序运行)时,项目开始,但当我打开浏览器时,我可以看到以下布局: 如果在Eclipse上的项目文件夹中,我右键单击索引。html页面,我选择“打开与”和“网页浏览器”,网站的布局显示在正确的方式。 这是我的项目结构: 我做错什么了吗? 这里是我的项目的依赖关系:

  • 我们目前正在Cent OS机器上与Tomcat 6和Java 7一起使用JProfiler 8.0.4,以准备评测模式。我们使用具有浮动许可证的JProfiler。我们在远程服务器上提取了JProfiler Linux存档。 Tomcat由Tanuki Wrapper管理。这是我们的配置 这很有效,当启动时,我们在日志中发现了这一点 最后,我们正在与我们的JProfiler客户联系,以获得代理和一

  • 我的dockerfile和wildfly配置有问题。我使用以下Dockerfile作为基础:https://github.com/mosaic-hgw/wildfly/blob/master/Dockerfile,我根据我的私人项目的需要对其进行了扩展。我想将现有的项目迁移到Docker,但是在部署WAR文件时,我得到了以下我不明白的错误消息。 现在错误是: 10:06:33,316错误[org.

  • 当我运行这个应用程序时,它抱怨说: org.xml.sax.saxParseException:schemaLocation:schemaLocation值=

  • 如有任何建议/暗示,不胜感激。

  • 我是Spring和J2EE的新手。我在使用带有Spring Boot自动配置的JDBC模板时遇到了问题。 我所做的是我以这里提供的RESTful Web服务为例,并决定将其扩展到使用JDBC模板关系数据库访问。不幸的是,提供的另一个示例不能有用,因为没有考虑从xml bean文件提供dataSource的唯一困难。 使用DAO Impl类作为Spring不同实现的扩展 我尝试了在Stack或Goo