如果不改框架的话
来源:11-3 引入缓存技术之理论讲解
appleday
2019-04-28
老师,我没有改框架,有几个问题: 1.不改框架微信接口登录的url是否还需要剥离呢? 2.我将到14章13节代码按照1.0的方法部署到服务器以后出现了500错误,Error creating bean with name ‘shopAuthManagementController’: Injection of autowired dependencies failed; nested exception is java.lang.IllegalArgumentException: Could not resolve placeholder ‘wechat.prefix’ in value "${wechat.prefix}"
org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:372)
好像是依赖注入失败,无法解析,是我漏添加了依赖,还是配置错了呢?我的pom.xml文件如下
4.0.0
com.imooc
o2o
war
0.0.1-SNAPSHOT
o2o Maven Webapp
http://maven.apache.org
<spring.version>4.3.7.RELEASE</spring.version>
junit
junit
4.12
test
ch.qos.logback
logback-classic
1.2.3
org.springframework
spring-core
KaTeX parse error: Expected 'EOF', got '这' at position 53: …ency>
<!-- 2)这̲个jar 文件是所有应用都要用…{spring.version}
org.springframework
spring-context
KaTeX parse error: Expected 'EOF', got '这' at position 54: …ncy>
<!-- 4) 这̲个jar 文件包含对Sprin…{spring.version}
org.springframework
spring-tx
KaTeX parse error: Expected 'EOF', got '包' at position 64: …- 6)Spring web 包̲含Web应用开发时,用到Spr…{spring.version}
org.springframework
spring-webmvc
KaTeX parse error: Expected 'EOF', got '对' at position 65: … 8)Spring test 对̲JUNIT等测试框架的简单封装…{spring.version}
test
javax.servlet
javax.servlet-api
3.1.0
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId>
<version>1.2.37</version>
</dependency>
<dependency>
<groupId>com.squareup.okhttp3</groupId>
<artifactId>okhttp</artifactId>
<version>3.2.0</version>
</dependency>
<!-- json解析 -->
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.8.7</version>
</dependency>
<!-- Map工具类 对标准java Collection的扩展 spring-core.jar需commons-collections.jar -->
<dependency>
<groupId>commons-collections</groupId>
<artifactId>commons-collections</artifactId>
<version>3.2</version>
</dependency>
<!-- DAO: MyBatis -->
<dependency>
<groupId>org.mybatis</groupId>
<artifactId>mybatis</artifactId>
<version>3.4.2</version>
</dependency>
<dependency>
<groupId>org.mybatis</groupId>
<artifactId>mybatis-spring</artifactId>
<version>1.3.1</version>
</dependency>
<!-- 数据库 -->
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.37</version>
</dependency>
<dependency>
<groupId>c3p0</groupId>
<artifactId>c3p0</artifactId>
<version>0.9.1.2</version>
</dependency>
<!-- 图片处理 -->
<!-- https://mvnrepository.com/artifact/net.coobird/thumbnailator -->
<dependency>
<groupId>net.coobird</groupId>
<artifactId>thumbnailator</artifactId>
<version>0.4.8</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.github.penggle/kaptcha -->
<dependency>
<groupId>com.github.penggle</groupId>
<artifactId>kaptcha</artifactId>
<version>2.3.2</version>
</dependency>
<!-- 二维码相关 -->
<!-- https://mvnrepository.com/artifact/com.google.zxing/javase -->
<dependency>
<groupId>com.google.zxing</groupId>
<artifactId>javase</artifactId>
<version>3.3.0</version>
</dependency>
<dependency>
<groupId>com.google.zxing</groupId>
<artifactId>core</artifactId>
<version>3.0.0</version>
</dependency>
<dependency>
<groupId>commons-fileupload</groupId>
<artifactId>commons-fileupload</artifactId>
<version>1.3.2</version>
</dependency>
<!-- redis客户端:Jedis -->
<dependency>
<groupId>redis.clients</groupId>
<artifactId>jedis</artifactId>
<version>2.9.0</version>
</dependency>
</dependencies>
<build>
<finalName>o2o</finalName>
<plugins>
<plugin>
<!-- https://mvnrepository.com/artifact/org.apache.maven.plugins/maven-compiler-plugin -->
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.6.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
<encoding>UTF8</encoding>
</configuration>
</plugin>
</plugins>
</build>
1回答
-
翔仔
2019-04-29
如果不按照视频里的迁移的话还是需要认真看视频的,这里是
@Value("${wechat.prefix}")
public void setUrlPrefix(String urlPrefix) {
MyAwardController.urlPrefix = urlPrefix;
}
主要从application.properties里面读取
就跟jdbc.properties里面读取变量一样,同学也可以硬编码进去,但是前提你得看懂视频,主要都是一些配置的变量
00
相似问题