TileConfigure已弃用??如何在SpringMVC3.1中使用tile2.2?
我试图将SpringMVC3.1与ApacheTile2.2集成,但发现了这个错误TileConfigure已弃用??如何在SpringMVC3.1中使用tile2.2?,spring,spring-mvc,frameworks,apache-tiles,Spring,Spring Mvc,Frameworks,Apache Tiles,我试图将SpringMVC3.1与ApacheTile2.2集成,但发现了这个错误 Error creating bean with name 'tilesConfigurer' defined in ServletContext resource [/WEB-INF/tiles-context.xml]: Invocation of init method failed 所以我在google中搜索它,发现ApacheTile2的结构已经改变或不推荐,但SpringMVC3.1仍然使用旧的结构
Error creating bean with name 'tilesConfigurer' defined in ServletContext resource [/WEB-INF/tiles-context.xml]: Invocation of init method failed
所以我在google中搜索它,发现ApacheTile2的结构已经改变或不推荐,但SpringMVC3.1仍然使用旧的结构。(有人说我们必须修改类等)
这些是我使用的库:
tiles-api-2.2.2.jar
tiles-core-2.2.2.jar
tiles-el-2.2.2.jar
tiles-jsp-2.2.2.jar
tiles-servlet-2.2.2.jar
tiles-template-2.2.2.jar
adn spring mvc
org.springframework.aop-3.1.0.M1.jar
org.springframework.asm-3.1.0.M1.jar
org.springframework.aspects-3.1.0.M1.jar
org.springframework.beans-3.1.0.M1.jar
org.springframework.context.support-3.1.0.M1.jar
org.springframework.context-3.1.0.M1.jar
org.springframework.core-3.1.0.M1.jar
org.springframework.expression-3.1.0.M1.jar
org.springframework.instrument.tomcat-3.1.0.M1.jar
org.springframework.instrument-3.1.0.M1.jar
org.springframework.jdbc-3.1.0.M1.jar
org.springframework.jms-3.1.0.M1.jar
org.springframework.orm-3.1.0.M1.jar
org.springframework.oxm-3.1.0.M1.jar
org.springframework.test-3.1.0.M1.jar
org.springframework.transaction-3.1.0.M1.jar
org.springframework.web.portlet-3.1.0.M1.jar
org.springframework.web.servlet-3.1.0.M1.jar
org.springframework.web.struts-3.1.0.M1.jar
org.springframework.web-3.1.0.M1.jar
有人知道我是怎么解决的吗?这对我很有用。(由OP在问题编辑中回答。转换为社区wiki答案。请参阅)
OP写道:
解决方案:
这不是不推荐的错误,而是关于jar文件的版本不正确
我通过在web应用程序中找到合适的jar解决了这个问题
这是我的罐子
因为有些人会像我一样迷路,玛特
如果从org.springframework.web.servlet.view.tiles3软件包导入,则不会出现任何磨损问题,但如果从org.springframework.web.servlet.view.tiles2导入,则会折旧。我通过改变进口解决了这个问题。 配置类
package mum.waa;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.view.tiles3.TilesConfigurer;
import org.springframework.web.servlet.view.tiles3.TilesView;
import org.springframework.web.servlet.view.tiles3.TilesViewResolver;
@Configuration
public class TilesConfiguration{
public TilesConfigurer tilesConfigurer()
{
final TilesConfigurer configurer = new TilesConfigurer();
configurer.setDefinitions(new String[] { "WEB-INF/tiles.xml" });
configurer.setCheckRefresh(true);
return configurer;
}
@Bean
public TilesViewResolver tilesViewResolver() {
final TilesViewResolver resolver = new TilesViewResolver();
resolver.setViewClass(TilesView.class);
return resolver;
}
}
依赖关系
<!-- Apache Tiles -->
<dependency>
<groupId>org.apache.tiles</groupId>
<artifactId>tiles-extras</artifactId>
<version>3.0.7</version>
</dependency>
<dependency>
<groupId>org.apache.tiles</groupId>
<artifactId>tiles-jsp</artifactId>
<version>3.0.7</version>
</dependency>
<!-- Apache Tiles -->
org.apache.tiles
附加瓷砖
3.0.7
org.apache.tiles
平铺jsp
3.0.7
<!-- Apache Tiles -->
<dependency>
<groupId>org.apache.tiles</groupId>
<artifactId>tiles-extras</artifactId>
<version>3.0.7</version>
</dependency>
<dependency>
<groupId>org.apache.tiles</groupId>
<artifactId>tiles-jsp</artifactId>
<version>3.0.7</version>
</dependency>
<!-- Apache Tiles -->