排行榜

  • 用户榜
  • 标签榜
  • 冲榜分奖金

频道

最新最热悬赏待采纳 筛选
  • 1

    回答

  • 12

    浏览

如题,我在使用springboot+thymeleaf+ajax局部刷新后,css产生了变化,如下图所示 这个是没有点击“地区选择”部分 这个是点击option之后 我的.ajax代码如下: function postData(){ var url="/index/check"; $.ajax({ url:url, type:'POST', data:{ "area":$("[name='area']").val(), "country":$("[name='country']").val(), "city":$("[name='city']").val(), "year":$("[name='year']").val() }, success:function (data){ $('#changeDiv').html(data); } }) } controller层设置如下: @PostMapping("/index/check") public String IndexInfoCollection(UserChose userChose, HttpSession session, Model model){ Year year=userChose.getYear(); //在数据库中查找一级指标 List<String> allSecondIndex= userCheckService.SelectSecondIndex(year); model.addAttribute("allSecondIndexName",allSecondIndex); return "domain/checkEditIndex :: tableList"; } 请求用什么办法可以令css一致

回答 Lyyyc?
采纳率100%
3小时前
  • 2

    回答

  • 20

    浏览

自己创建了一个过滤器继承了AbstractGatewayFilterFactory 这个类,下面是配置。 routes: - id: provider uri: lb://provider predicates: - Path=/provider/** filters: - name: AuthenticationFilter 测试时出现了神奇的一幕。我不启动provider服务,通过网关访问这个服务的一个接口,可以进入过滤器;当我吧provider启动之后,再次访问这个地址,就不进入过滤器,直接能访问成功provider。在网上查很久没有查到原因。   有大神帮忙解释一下吗。

  • 4

    回答

  • 18

    浏览

控制器类 /** * 根据id查询管理员信息的请求处理方法 * @param id * @return */ @RequestMapping(value = "/select.do") public AdminBean findOne(Integer id){ AdminBean adminBean = adminBeanService.findOne(id); return adminBean; } ajax发送请求 // 测试查询 $("#but4").click(function () { $.ajax({ url:"adminBean/select.do?id=1", type:"GET", datatype:"json", // dataType:"json", // dataTypes:"json", contentType:"application/json", success:function (response) { // alert(response); console.log(JSON.stringify(response)); } }) }) 在查询的数据没有时,控制器类返回一个空对象null,前端接收的数据使用 datatype和dataTypes可以得到""空字符串,而使用dataType则没有反应。

  • 2

    回答

  • 14

    浏览

这个7002的启动类应该是在cloud-eureka-7002下的,求解 

回答 tupaiopiao
采纳率45.5%
10小时前
  • 4

    回答

  • 58

    浏览

之前项目都能用,重新加载了一下tomcat就不能了哎 这是登录页面跳转   然后登录后就404了The origin server did not find a current representation for the target resource or is not willing to disclose that one exists. 这是我的Controller文件 这是是spring文件配置   请求地址http://localhost:8080/check-user-info后来我试了一下,发现必须要带上/项目名/check-user-info 不知道怎么回事,但之前还能用1=求解答

  • 1

    回答

  • 16

    浏览

这个modle被我删了建了几次,我怀疑没有删干净,生成的target没有主启动类只有yml   怎么办 

回答 tupaiopiao
采纳率45.5%
22小时前
  • 4

    回答

  • 35

    浏览

要单独取执行test插件才能运行测试类,求大神指点怎么自动编译测试类中的类,不点击test插件,左边target中的文件没有下面两个  

  • 4

    回答

  • 25

    浏览

求助大佬 jpa中,需要分页,specification中需要自定义排序,所以使用了下面的代码,又需要验证其他表,所以使用了left join,导致查询出来的数据重复,使用distinct,但是报 "在查询列表中必须出现SELECT DISTINCT, ORDER BY表达式".查询很多资料后,可使用group by,虽然可以去重,但返回的分页数据中的totalElements与实际的totalElements不相等(是未group by后的长度), 求助求助呀   List<Order> orders = new ArrayList<>();         orders.add(cb.asc(cb.selectCase().when(cb.equal(root.get("contractStatus").as(Byte.class), 2), 1)             .when(cb.equal(root.get("contractStatus").as(Byte.class), 4), 2)             .when(cb.equal(root.get("contractStatus").as(Byte.class), 1), 3)             .when(cb.equal(root.get("contractStatus").as(Byte.class), 3), 4).otherwise(10)));         orders.add(cb.desc(root.get("createDate")));         query.orderBy(orders);

  • 3

    回答

  • 14

    浏览

Spring boot 项目启动之后,本地访问一直出错 不管访问什么都是untaught typeerror:cannot read property 'src' of null 然后是重复5遍的 At module. commons. js:87 At _webpack_require_ content. js:1

  • 1

    回答

  • 12

    浏览

问题说明:项目在idea上运行没有问题,但是打war时继承 SpringBootServletInitializer时报Error creating bean失败  有没有大佬遇到过

回答 逍遥鑫
采纳率50%
昨天
  • 6

    回答

  • 51

    浏览

  .   ____          _            __ _ _  /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \ ( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \  \\/  ___)| |_)| | | | | || (_| |  ) ) ) )   '  |____| .__|_| |_|_| |_\__, | / / / /  =========|_|==============|___/=/_/_/_/  :: Spring Boot ::        (v2.0.2.RELEASE) 2021-05-06 17:22:31.292  INFO 17628 --- [           main] cn.itcast.jd.Application                 : Starting Application on LAPTOP-C6EFEFE7 with PID 17628 (started by zhangmingze in D:\java项目\pachong) 2021-05-06 17:22:31.296  INFO 17628 --- [           main] cn.itcast.jd.Application                 : No active profile set, falling back to default profiles: default 2021-05-06 17:22:31.377  INFO 17628 --- [           main] ConfigServletWebServerApplicationContext : Refreshing org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext@71e9ddb4: startup date [Thu May 06 17:22:31 CST 2021]; root of context hierarchy 2021-05-06 17:22:32.372  INFO 17628 --- [           main] .s.d.r.c.RepositoryConfigurationDelegate : Multiple Spring Data modules found, entering strict repository configuration mode! 2021-05-06 17:22:32.417  INFO 17628 --- [           main] .RepositoryConfigurationExtensionSupport : Spring Data Redis - Could not safely identify store assignment for repository candidate interface cn.itcast.jd.dao.ItemDao. 2021-05-06 17:22:32.537 ERROR 17628 --- [           main] o.s.boot.SpringApplication               : Application run failed java.lang.IllegalStateException: Cannot load configuration class: cn.itcast.jd.Application     at org.springframework.context.annotation.ConfigurationClassPostProcessor.enhanceConfigurationClasses(ConfigurationClassPostProcessor.java:414) ~[spring-context-5.0.6.RELEASE.jar:5.0.6.RELEASE]     at org.springframework.context.annotation.ConfigurationClassPostProcessor.postProcessBeanFactory(ConfigurationClassPostProcessor.java:254) ~[spring-context-5.0.6.RELEASE.jar:5.0.6.RELEASE]     at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:284) ~[spring-context-5.0.6.RELEASE.jar:5.0.6.RELEASE]     at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:128) ~[spring-context-5.0.6.RELEASE.jar:5.0.6.RELEASE]     at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:694) ~[spring-context-5.0.6.RELEASE.jar:5.0.6.RELEASE]     at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:532) ~[spring-context-5.0.6.RELEASE.jar:5.0.6.RELEASE]     at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:140) ~[spring-boot-2.0.2.RELEASE.jar:2.0.2.RELEASE]     at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:759) ~[spring-boot-2.0.2.RELEASE.jar:2.0.2.RELEASE]     at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:395) ~[spring-boot-2.0.2.RELEASE.jar:2.0.2.RELEASE]     at org.springframework.boot.SpringApplication.run(SpringApplication.java:327) ~[spring-boot-2.0.2.RELEASE.jar:2.0.2.RELEASE]     at org.springframework.boot.SpringApplication.run(SpringApplication.java:1255) ~[spring-boot-2.0.2.RELEASE.jar:2.0.2.RELEASE]     at org.springframework.boot.SpringApplication.run(SpringApplication.java:1243) ~[spring-boot-2.0.2.RELEASE.jar:2.0.2.RELEASE]     at cn.itcast.jd.Application.main(Application.java:18) ~[classes/:na] Caused by: java.lang.ExceptionInInitializerError: null     at org.springframework.context.annotation.ConfigurationClassEnhancer.newEnhancer(ConfigurationClassEnhancer.java:122) ~[spring-context-5.0.6.RELEASE.jar:5.0.6.RELEASE]     at org.springframework.context.annotation.ConfigurationClassEnhancer.enhance(ConfigurationClassEnhancer.java:110) ~[spring-context-5.0.6.RELEASE.jar:5.0.6.RELEASE]     at org.springframework.context.annotation.ConfigurationClassPostProcessor.enhanceConfigurationClasses(ConfigurationClassPostProcessor.java:403) ~[spring-context-5.0.6.RELEASE.jar:5.0.6.RELEASE]     ... 12 common frames omitted Caused by: org.springframework.cglib.core.CodeGenerationException: java.lang.reflect.InaccessibleObjectException-->Unable to make protected final java.lang.Class java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int,java.security.ProtectionDomain) throws java.lang.ClassFormatError accessible: module java.base does not "opens java.lang" to unnamed module @371a67ec     at org.springframework.cglib.core.ReflectUtils.defineClass(ReflectUtils.java:464) ~[spring-core-5.0.6.RELEASE.jar:5.0.6.RELEASE]     at org.springframework.cglib.core.AbstractClassGenerator.generate(AbstractClassGenerator.java:336) ~[spring-core-5.0.6.RELEASE.jar:5.0.6.RELEASE]     at org.springframework.cglib.core.AbstractClassGenerator$ClassLoaderData$3.apply(AbstractClassGenerator.java:93) ~[spring-core-5.0.6.RELEASE.jar:5.0.6.RELEASE]     at org.springframework.cglib.core.AbstractClassGenerator$ClassLoaderData$3.apply(AbstractClassGenerator.java:91) ~[spring-core-5.0.6.RELEASE.jar:5.0.6.RELEASE]     at org.springframework.cglib.core.internal.LoadingCache$2.call(LoadingCache.java:54) ~[spring-core-5.0.6.RELEASE.jar:5.0.6.RELEASE]     at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) ~[na:na]     at org.springframework.cglib.core.internal.LoadingCache.createEntry(LoadingCache.java:61) ~[spring-core-5.0.6.RELEASE.jar:5.0.6.RELEASE]     at org.springframework.cglib.core.internal.LoadingCache.get(LoadingCache.java:34) ~[spring-core-5.0.6.RELEASE.jar:5.0.6.RELEASE]     at org.springframework.cglib.core.AbstractClassGenerator$ClassLoaderData.get(AbstractClassGenerator.java:116) ~[spring-core-5.0.6.RELEASE.jar:5.0.6.RELEASE]     at org.springframework.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:291) ~[spring-core-5.0.6.RELEASE.jar:5.0.6.RELEASE]     at org.springframework.cglib.core.KeyFactory$Generator.create(KeyFactory.java:221) ~[spring-core-5.0.6.RELEASE.jar:5.0.6.RELEASE]     at org.springframework.cglib.core.KeyFactory.create(KeyFactory.java:174) ~[spring-core-5.0.6.RELEASE.jar:5.0.6.RELEASE]     at org.springframework.cglib.core.KeyFactory.create(KeyFactory.java:153) ~[spring-core-5.0.6.RELEASE.jar:5.0.6.RELEASE]     at org.springframework.cglib.proxy.Enhancer.<clinit>(Enhancer.java:73) ~[spring-core-5.0.6.RELEASE.jar:5.0.6.RELEASE]     ... 15 common frames omitted Caused by: java.lang.reflect.InaccessibleObjectException: Unable to make protected final java.lang.Class java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int,java.security.ProtectionDomain) throws java.lang.ClassFormatError accessible: module java.base does not "opens java.lang" to unnamed module @371a67ec     at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:357) ~[na:na]     at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:297) ~[na:na]     at java.base/java.lang.reflect.Method.checkCanSetAccessible(Method.java:199) ~[na:na]     at java.base/java.lang.reflect.Method.setAccessible(Method.java:193) ~[na:na]     at org.springframework.cglib.core.ReflectUtils$1.run(ReflectUtils.java:61) ~[spring-core-5.0.6.RELEASE.jar:5.0.6.RELEASE]     at java.base/java.security.AccessController.doPrivileged(AccessController.java:554) ~[na:na]     at org.springframework.cglib.core.ReflectUtils.<clinit>(ReflectUtils.java:52) ~[spring-core-5.0.6.RELEASE.jar:5.0.6.RELEASE]     at org.springframework.cglib.core.KeyFactory$Generator.generateClass(KeyFactory.java:243) ~[spring-core-5.0.6.RELEASE.jar:5.0.6.RELEASE]     at org.springframework.cglib.core.DefaultGeneratorStrategy.generate(DefaultGeneratorStrategy.java:25) ~[spring-core-5.0.6.RELEASE.jar:5.0.6.RELEASE]     at org.springframework.cglib.core.AbstractClassGenerator.generate(AbstractClassGenerator.java:329) ~[spring-core-5.0.6.RELEASE.jar:5.0.6.RELEASE]     ... 27 common frames omitted 2021-05-06 17:22:32.538  INFO 17628 --- [           main] ConfigServletWebServerApplicationContext : Closing org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext@71e9ddb4: startup date [Thu May 06 17:22:31 CST 2021]; root of context hierarchy   不知道错误在哪里,都是照着视频敲的 (还不太懂)  - - 求大佬们帮忙解决

  • 5

    回答

  • 24

    浏览

SpringBoot用maven打成jar程序包不存在问题 报程序包不存在,我这两个jar包不是导入依赖的方式加到项目里的,而是我从网上下的jar包如何复制到项目里的1个文件夹再使用的,在idea里可以运行项目没问题,现在打包就出现了问题。在两个Jar包我是放在这里的: 希望各位大神解答一下~~

  • 4

    回答

  • 20

    浏览

这个写完报错HTTP Status 400 - Missing cookie 'JSESSIONID' for method parameter of type String

  • 7

    回答

  • 57

    浏览

我是做的是后台是intellij idea、前台是Android studio、数据库是MySQL的APP。前台和数据库运行都没有问题,但是在使用模拟器的时候,会出现请求失败。然后有人告诉我是后台出现了问题。下面是后台intellij idea在运行时红色的字: org.apache.coyote.AbstractProtocol init 信息: Initializing ProtocolHandler ["http-nio-8081"] org.apache.catalina.core.StandardService startInternal 信息: Starting service [Tomcat] org.apache.catalina.core.StandardEngine startInternal 信息: Starting Servlet engine: [Apache Tomcat/9.0.35] org.apache.catalina.core.ApplicationContext log 信息: Initializing Spring embedded WebApplicationContext org.apache.coyote.AbstractProtocol start 信息: Starting ProtocolHandler ["http-nio-8081"]

  • 5

    回答

  • 47

    浏览

前端没有用vue脚手架开发,不太熟 前端请求代码: findALl() { axios.get("http://localhost:9090/blog/findAll", // {async:true}, // // {crossDomain:true}, {headers: {token:'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJwYXNzd29yZCI6IjAxNDRjYzU5NTcyMDY2OTYyMDIxNWQwMjljZWMwNDZlIiwiZXhwIjoxNjIwMjY1OTYxLCJ1c2VybmFtZSI6ImFkbWluIn0.xCPFVgHoUzrl8b2ZaU6CJeFin9iqadSCnWQaCUwpP5o'}}, ).then(res => { console.log(JSON.parse(JSON.stringify(res.data))); // this.tableData = res.data; }) },     后端一直取不到headers里的token信息 明明再postman里面测试的时候可以接收到,不太懂,有没有大佬指点一下

  • 5

    回答

  • 32

    浏览

29-Apr-2021 17:05:06.680 INFO [localhost-startStop-4] org.apache.catalina.startup.HostConfig.deployWAR Deploying web application archive [/www/tomcat80/webapps/demo.war] 29-Apr-2021 17:05:07.137 WARNING [localhost-startStop-4] org.apache.tomcat.util.descriptor.web.WebXml.setVersion Unknown version string [4.0]. Default version will be used. 29-Apr-2021 17:05:11.176 SEVERE [localhost-startStop-4] org.apache.catalina.core.ContainerBase.addChildInternal ContainerBase.addChild: start: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/demo]] at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:167) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:754) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:730) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:734) at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:980) at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1852) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748) Caused by: java.lang.NoSuchMethodError: org.slf4j.spi.LocationAwareLogger.log(Lorg/slf4j/Marker;Ljava/lang/String;ILjava/lang/String;[Ljava/lang/Object;Ljava/lang/Throwable;)V at org.apache.commons.logging.LogAdapter$Slf4jLocationAwareLog.error(LogAdapter.java:410) at org.springframework.boot.SpringApplication.reportFailure(SpringApplication.java:858) at org.springframework.boot.SpringApplication.handleRunFailure(SpringApplication.java:832) at org.springframework.boot.SpringApplication.run(SpringApplication.java:327) at org.springframework.boot.web.servlet.support.SpringBootServletInitializer.run(SpringBootServletInitializer.java:157) at org.springframework.boot.web.servlet.support.SpringBootServletInitializer.createRootApplicationContext(SpringBootServletInitializer.java:137) at org.springframework.boot.web.servlet.support.SpringBootServletInitializer.onStartup(SpringBootServletInitializer.java:91) at org.springframework.web.SpringServletContainerInitializer.onStartup(SpringServletContainerInitializer.java:171) at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5225) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) ... 10 more  

  • 3

    回答

  • 33

    浏览

Javabean 中字段也都用了注解,  private static final long serialVersionUID = 1L; public int id; public String editNo; public String registName; @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8") @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") public Timestamp submitDate; @JsonFormat(pattern = "yyyy-MM-dd",timezone="GMT+8") @DateTimeFormat(pattern = "yyyy-MM-dd") public Timestamp createDate; 前台页面输入参数为: mapper.xml sql 如下: 后台报错如下图:找到非法字符,但是这个sql 我拿到plsq工具中将传入参数改为值 是可以执行的啊 说明脚步应该没问题,估计是spring mvc 处理参数的时候有问题   

回答 麶槑
采纳率20%
2天前
  • 1

    回答

  • 14

    浏览

安装语句 docker run -d --name redis -p 6379:6379 --restart always redis:5.0.5 显示结果 [root@192 ~]# docker run -itd --name redis-test -p 6379:6379 redis e8289f097be216f29679cf4c8c250177ed8f753bd1fad9c728756376939c872f docker: Error response from daemon: cannot start a stopped process: unknown. 泊坞窗:来自守护程序的错误响应:无法启动已停止的进程:未知。 怎么解决?? 再次运行docker run -d --name redis -p 6379:6379 --restart always redis:5.0.5 显示 docker: Error response from daemon: Conflict. The container name "/redis-test" is already in use by container "e8289f097be216f29679cf4c8c250177ed8f753bd1fad9c728756376939c872f". You have to remove (or rename) that container to be able to reuse that name. See 'docker run --help'. 但是我的Docker里面没有任何镜像在运行

回答 仇天临
采纳率50%
3天前
  • 3

    回答

  • 51

    浏览

IDEA 在运行maven项目的时候似乎dao层报错数据库是Oracle11驱动的版本是10.2.0.1.0 下面是全部的错误信息 五月 04, 2021 7:14:30 下午 org.apache.catalina.core.StandardWrapperValve invoke 严重: Servlet.service() for servlet [dispatcherServlet] in context with path [/zheng_ssm_web] threw exception [Request processing failed; nested exception is org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.exceptions.PersistenceException:  ### Error querying database.  Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection; nested exception is java.sql.SQLException: Connections could not be acquired from the underlying database! ### The error may exist in com/itzheng/ssm/dao/IProductDao.java (best guess) ### The error may involve com.itzheng.ssm.dao.IProductDao.findAll ### The error occurred while executing a query ### Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection; nested exception is java.sql.SQLException: Connections could not be acquired from the underlying database!] with root cause com.mchange.v2.resourcepool.CannotAcquireResourceException: A ResourcePool could not acquire a resource from its primary factory or source.     at com.mchange.v2.resourcepool.BasicResourcePool.awaitAvailable(BasicResourcePool.java:1319)     at com.mchange.v2.resourcepool.BasicResourcePool.prelimCheckoutResource(BasicResourcePool.java:557)     at com.mchange.v2.resourcepool.BasicResourcePool.checkoutResource(BasicResourcePool.java:477)     at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool.checkoutPooledConnection(C3P0PooledConnectionPool.java:525)     at com.mchange.v2.c3p0.impl.AbstractPoolBackedDataSource.getConnection(AbstractPoolBackedDataSource.java:128)     at org.springframework.jdbc.datasource.DataSourceUtils.fetchConnection(DataSourceUtils.java:157)     at org.springframework.jdbc.datasource.DataSourceUtils.doGetConnection(DataSourceUtils.java:115)     at org.springframework.jdbc.datasource.DataSourceUtils.getConnection(DataSourceUtils.java:78)     at org.mybatis.spring.transaction.SpringManagedTransaction.openConnection(SpringManagedTransaction.java:80)     at org.mybatis.spring.transaction.SpringManagedTransaction.getConnection(SpringManagedTransaction.java:67)     at org.apache.ibatis.executor.BaseExecutor.getConnection(BaseExecutor.java:336)     at org.apache.ibatis.executor.SimpleExecutor.prepareStatement(SimpleExecutor.java:85)     at org.apache.ibatis.executor.SimpleExecutor.doQuery(SimpleExecutor.java:62)     at org.apache.ibatis.executor.BaseExecutor.queryFromDatabase(BaseExecutor.java:324)     at org.apache.ibatis.executor.BaseExecutor.query(BaseExecutor.java:156)     at org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:109)     at org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:83)     at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:147)     at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:140)     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)     at java.lang.reflect.Method.invoke(Method.java:498)     at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:426)     at com.sun.proxy.$Proxy36.selectList(Unknown Source)     at org.mybatis.spring.SqlSessionTemplate.selectList(SqlSessionTemplate.java:223)     at org.apache.ibatis.binding.MapperMethod.executeForMany(MapperMethod.java:147)     at org.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java:80)     at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:57)     at com.sun.proxy.$Proxy38.findAll(Unknown Source)     at com.itzheng.ssm.service.impl.ProductServiceImpl.findAll(ProductServiceImpl.java:22)     at com.itzheng.ssm.controller.ProductController.findAll(ProductController.java:24)     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)     at java.lang.reflect.Method.invoke(Method.java:498)     at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:209)     at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:136)     at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:102)     at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:894)     at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:800)     at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87)     at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:991)     at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:925)     at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:981)     at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:873)     at javax.servlet.http.HttpServlet.service(HttpServlet.java:621)     at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:858)     at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)     at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)     at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)     at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:51)     at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)     at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)     at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:200)     at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)     at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)     at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)     at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)     at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)     at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)     at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)     at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100)     at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:953)     at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)     at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)     at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1041)     at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:603)     at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:310)     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)     at java.lang.Thread.run(Thread.java:748)

  • 3

    回答

  • 28

    浏览

其实关于这个看了挺多的文章,基本都说什么兄弟关系所以不能用实现类接,得用接口接,总感觉理解得不顺畅,兄弟关系跟不能用实现类接有必然关系吗? 我的代码逻辑如下: 1.我在service类上@service,spring应该会帮我创建一个该类的对象吧 2.启动了切面拦截和动态代理,spring又会给我创建一个jdk动态代理的对象,名字改为我原先的bean的名字 (疑问:此时实现了service父接口的bean到底是有一个还是有两个,动态代理的bean是重命名形式的偷梁换柱还是直接霸道覆盖掉之前的bean) 3.不开启jdk动态代理时,用service实现类接会正常注入service对象, 但是开启动态代理时如果用service实现类接的话会报错, 错误信息: Bean named 'monsterServiceImpl' is expected to be of type 'cn.tedu.service.MonsterServiceImpl' but was actually of type 'com.sun.proxy.$Proxy25' 也就是说autowired在bean中查找到的实际上就是代理类 疑问:autowired按照类型查找(实现类)不应该是只有一个类(目标类)吗,为什么执行结果就好像按照类型查找不到目标类的bean,然后根据autowired的规则继续按照名字查找,正好找到了代理类的bean,注入时发现类型是service实现类,而他找到的是代理类(此时是兄弟关系),因此注入失败,报错信息就是上面的: 自动注入的bean期望是一个service实现类但实际是代理类 所以说,如果启动了jdk动态代理,此时bean容器中代理类的bean就把我的@controller的bean覆盖掉了,我的@service的bean其实不是名字被占用了,而是直接就被覆盖掉就没有了是吗?又或者是spring刚开始就没给我创建目标类的bean? 感觉陷入了什么误区,希望各位大佬能给解答一下

  • 0

    回答

  • 9

    浏览

Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled. 2021-05-03 17:59:56.683 ERROR 19940 --- [  restartedMain] o.s.b.d.LoggingFailureAnalysisReporter   :  *************************** APPLICATION FAILED TO START *************************** Description: Failed to bind properties under 'mybatis.configuration' to org.apache.ibatis.session.Configuration:     Reason: No converter found capable of converting from type [java.lang.String] to type [@org.springframework.boot.context.properties.NestedConfigurationProperty org.apache.ibatis.session.Configuration] Action: Update your application's configuration    

回答 120366
采纳率50%
4天前
  • 2

    回答

  • 18

    浏览

如何返回application/x-www-form-urlencoded类型的Json给前端。

回答 Ingsuifon
采纳率25%
4天前
  • 1

    回答

  • 10

    浏览

"C:\Program Files\Java\jdk1.8.0_291\bin\java.exe" -XX:TieredStopAtLevel=1 -noverify -Dspring.output.ansi.enabled=always "-javaagent:C:\IntelliJ IDEA 2021.1\lib\idea_rt.jar=56203:C:\IntelliJ IDEA 2021.1\bin" -Dcom.sun.management.jmxremote -Dspring.jmx.enabled=true -Dspring.liveBeansView.mbeanDomain -Dspring.application.admin.enabled=true -Dfile.encoding=UTF-8 -classpath "C:\Program Files\Java\jdk1.8.0_291\jre\lib\charsets.jar;C:\Program Files\Java\jdk1.8.0_291\jre\lib\deploy.jar;C:\Program Files\Java\jdk1.8.0_291\jre\lib\ext\access-bridge-64.jar;C:\Program Files\Java\jdk1.8.0_291\jre\lib\ext\cldrdata.jar;C:\Program Files\Java\jdk1.8.0_291\jre\lib\ext\dnsns.jar;C:\Program Files\Java\jdk1.8.0_291\jre\lib\ext\jaccess.jar;C:\Program Files\Java\jdk1.8.0_291\jre\lib\ext\jfxrt.jar;C:\Program Files\Java\jdk1.8.0_291\jre\lib\ext\localedata.jar;C:\Program Files\Java\jdk1.8.0_291\jre\lib\ext\nashorn.jar;C:\Program Files\Java\jdk1.8.0_291\jre\lib\ext\sunec.jar;C:\Program Files\Java\jdk1.8.0_291\jre\lib\ext\sunjce_provider.jar;C:\Program Files\Java\jdk1.8.0_291\jre\lib\ext\sunmscapi.jar;C:\Program Files\Java\jdk1.8.0_291\jre\lib\ext\sunpkcs11.jar;C:\Program Files\Java\jdk1.8.0_291\jre\lib\ext\zipfs.jar;C:\Program Files\Java\jdk1.8.0_291\jre\lib\javaws.jar;C:\Program Files\Java\jdk1.8.0_291\jre\lib\jce.jar;C:\Program Files\Java\jdk1.8.0_291\jre\lib\jfr.jar;C:\Program Files\Java\jdk1.8.0_291\jre\lib\jfxswt.jar;C:\Program Files\Java\jdk1.8.0_291\jre\lib\jsse.jar;C:\Program Files\Java\jdk1.8.0_291\jre\lib\management-agent.jar;C:\Program Files\Java\jdk1.8.0_291\jre\lib\plugin.jar;C:\Program Files\Java\jdk1.8.0_291\jre\lib\resources.jar;C:\Program Files\Java\jdk1.8.0_291\jre\lib\rt.jar;E:\idea-workspace\spring_demo_03\target\classes;D:\IdeaJavaDev\JavaDev\DevlocalRepo3\org\springframework\boot\spring-boot-starter-thymeleaf\2.4.0\spring-boot-starter-thymeleaf-2.4.0.jar;D:\IdeaJavaDev\JavaDev\DevlocalRepo3\org\springframework\boot\spring-boot-starter\2.4.0\spring-boot-starter-2.4.0.jar;D:\IdeaJavaDev\JavaDev\DevlocalRepo3\org\springframework\boot\spring-boot-starter-logging\2.4.0\spring-boot-starter-logging-2.4.0.jar;D:\IdeaJavaDev\JavaDev\DevlocalRepo3\ch\qos\logback\logback-classic\1.2.3\logback-classic-1.2.3.jar;D:\IdeaJavaDev\JavaDev\DevlocalRepo3\ch\qos\logback\logback-core\1.2.3\logback-core-1.2.3.jar;D:\IdeaJavaDev\JavaDev\DevlocalRepo3\org\apache\logging\log4j\log4j-to-slf4j\2.13.3\log4j-to-slf4j-2.13.3.jar;D:\IdeaJavaDev\JavaDev\DevlocalRepo3\org\apache\logging\log4j\log4j-api\2.13.3\log4j-api-2.13.3.jar;D:\IdeaJavaDev\JavaDev\DevlocalRepo3\org\slf4j\jul-to-slf4j\1.7.30\jul-to-slf4j-1.7.30.jar;D:\IdeaJavaDev\JavaDev\DevlocalRepo3\jakarta\annotation\jakarta.annotation-api\1.3.5\jakarta.annotation-api-1.3.5.jar;D:\IdeaJavaDev\JavaDev\DevlocalRepo3\org\yaml\snakeyaml\1.27\snakeyaml-1.27.jar;D:\IdeaJavaDev\JavaDev\DevlocalRepo3\org\thymeleaf\thymeleaf-spring5\3.0.11.RELEASE\thymeleaf-spring5-3.0.11.RELEASE.jar;D:\IdeaJavaDev\JavaDev\DevlocalRepo3\org\thymeleaf\thymeleaf\3.0.11.RELEASE\thymeleaf-3.0.11.RELEASE.jar;D:\IdeaJavaDev\JavaDev\DevlocalRepo3\org\attoparser\attoparser\2.0.5.RELEASE\attoparser-2.0.5.RELEASE.jar;D:\IdeaJavaDev\JavaDev\DevlocalRepo3\org\unbescape\unbescape\1.1.6.RELEASE\unbescape-1.1.6.RELEASE.jar;D:\IdeaJavaDev\JavaDev\DevlocalRepo3\org\slf4j\slf4j-api\1.7.30\slf4j-api-1.7.30.jar;D:\IdeaJavaDev\JavaDev\DevlocalRepo3\org\thymeleaf\extras\thymeleaf-extras-java8time\3.0.4.RELEASE\thymeleaf-extras-java8time-3.0.4.RELEASE.jar;D:\IdeaJavaDev\JavaDev\DevlocalRepo3\org\springframework\boot\spring-boot-starter-web\2.4.0\spring-boot-starter-web-2.4.0.jar;D:\IdeaJavaDev\JavaDev\DevlocalRepo3\org\springframework\boot\spring-boot-starter-json\2.4.0\spring-boot-starter-json-2.4.0.jar;D:\IdeaJavaDev\JavaDev\DevlocalRepo3\com\fasterxml\jackson\core\jackson-databind\2.11.3\jackson-databind-2.11.3.jar;D:\IdeaJavaDev\JavaDev\DevlocalRepo3\com\fasterxml\jackson\core\jackson-annotations\2.11.3\jackson-annotations-2.11.3.jar;D:\IdeaJavaDev\JavaDev\DevlocalRepo3\com\fasterxml\jackson\core\jackson-core\2.11.3\jackson-core-2.11.3.jar;D:\IdeaJavaDev\JavaDev\DevlocalRepo3\com\fasterxml\jackson\datatype\jackson-datatype-jdk8\2.11.3\jackson-datatype-jdk8-2.11.3.jar;D:\IdeaJavaDev\JavaDev\DevlocalRepo3\com\fasterxml\jackson\datatype\jackson-datatype-jsr310\2.11.3\jackson-datatype-jsr310-2.11.3.jar;D:\IdeaJavaDev\JavaDev\DevlocalRepo3\com\fasterxml\jackson\module\jackson-module-parameter-names\2.11.3\jackson-module-parameter-names-2.11.3.jar;D:\IdeaJavaDev\JavaDev\DevlocalRepo3\org\springframework\boot\spring-boot-starter-tomcat\2.4.0\spring-boot-starter-tomcat-2.4.0.jar;D:\IdeaJavaDev\JavaDev\DevlocalRepo3\org\apache\tomcat\embed\tomcat-embed-core\9.0.39\tomcat-embed-core-9.0.39.jar;D:\IdeaJavaDev\JavaDev\DevlocalRepo3\org\glassfish\jakarta.el\3.0.3\jakarta.el-3.0.3.jar;D:\IdeaJavaDev\JavaDev\DevlocalRepo3\org\apache\tomcat\embed\tomcat-embed-websocket\9.0.39\tomcat-embed-websocket-9.0.39.jar;D:\IdeaJavaDev\JavaDev\DevlocalRepo3\org\springframework\spring-web\5.3.1\spring-web-5.3.1.jar;D:\IdeaJavaDev\JavaDev\DevlocalRepo3\org\springframework\spring-beans\5.3.1\spring-beans-5.3.1.jar;D:\IdeaJavaDev\JavaDev\DevlocalRepo3\org\springframework\spring-webmvc\5.3.1\spring-webmvc-5.3.1.jar;D:\IdeaJavaDev\JavaDev\DevlocalRepo3\org\springframework\spring-aop\5.3.1\spring-aop-5.3.1.jar;D:\IdeaJavaDev\JavaDev\DevlocalRepo3\org\springframework\spring-context\5.3.1\spring-context-5.3.1.jar;D:\IdeaJavaDev\JavaDev\DevlocalRepo3\org\springframework\spring-expression\5.3.1\spring-expression-5.3.1.jar;D:\IdeaJavaDev\JavaDev\DevlocalRepo3\org\springframework\boot\spring-boot-devtools\2.4.0\spring-boot-devtools-2.4.0.jar;D:\IdeaJavaDev\JavaDev\DevlocalRepo3\org\springframework\boot\spring-boot\2.4.0\spring-boot-2.4.0.jar;D:\IdeaJavaDev\JavaDev\DevlocalRepo3\org\springframework\boot\spring-boot-autoconfigure\2.4.0\spring-boot-autoconfigure-2.4.0.jar;D:\IdeaJavaDev\JavaDev\DevlocalRepo3\org\projectlombok\lombok\1.18.16\lombok-1.18.16.jar;D:\IdeaJavaDev\JavaDev\DevlocalRepo3\org\springframework\spring-core\5.3.1\spring-core-5.3.1.jar;D:\IdeaJavaDev\JavaDev\DevlocalRepo3\org\springframework\spring-jcl\5.3.1\spring-jcl-5.3.1.jar;D:\IdeaJavaDev\JavaDev\DevlocalRepo3\mysql\mysql-connector-java\8.0.22\mysql-connector-java-8.0.22.jar;D:\IdeaJavaDev\JavaDev\DevlocalRepo3\org\mybatis\spring\boot\mybatis-spring-boot-starter\2.0.1\mybatis-spring-boot-starter-2.0.1.jar;D:\IdeaJavaDev\JavaDev\DevlocalRepo3\org\mybatis\spring\boot\mybatis-spring-boot-autoconfigure\2.0.1\mybatis-spring-boot-autoconfigure-2.0.1.jar;D:\IdeaJavaDev\JavaDev\DevlocalRepo3\org\mybatis\mybatis\3.5.1\mybatis-3.5.1.jar;D:\IdeaJavaDev\JavaDev\DevlocalRepo3\org\mybatis\mybatis-spring\2.0.1\mybatis-spring-2.0.1.jar;D:\IdeaJavaDev\JavaDev\DevlocalRepo3\org\springframework\boot\spring-boot-starter-jdbc\2.4.0\spring-boot-starter-jdbc-2.4.0.jar;D:\IdeaJavaDev\JavaDev\DevlocalRepo3\com\zaxxer\HikariCP\3.4.5\HikariCP-3.4.5.jar;D:\IdeaJavaDev\JavaDev\DevlocalRepo3\org\springframework\spring-jdbc\5.3.1\spring-jdbc-5.3.1.jar;D:\IdeaJavaDev\JavaDev\DevlocalRepo3\org\springframework\spring-tx\5.3.1\spring-tx-5.3.1.jar" com.jt.SpringDemo03Application {spring.web.resources.chain.cache=false, spring.web.resources.cache.period=0}   .   ____          _            __ _ _  /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \ ( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \  \\/  ___)| |_)| | | | | || (_| |  ) ) ) )   '  |____| .__|_| |_|_| |_\__, | / / / /  =========|_|==============|___/=/_/_/_/  :: Spring Boot ::                (v2.4.0) 2021-05-03 17:05:53.184  INFO 13128 --- [  restartedMain] com.jt.SpringDemo03Application           : Starting SpringDemo03Application using Java 1.8.0_291 on DESKTOP-16UKO1B with PID 13128 (E:\idea-workspace\spring_demo_03\target\classes started by 1 in E:\idea-workspace) 2021-05-03 17:05:53.186  INFO 13128 --- [  restartedMain] com.jt.SpringDemo03Application           : No active profile set, falling back to default profiles: default 2021-05-03 17:05:53.232  INFO 13128 --- [  restartedMain] .e.DevToolsPropertyDefaultsPostProcessor : Devtools property defaults active! Set 'spring.devtools.add-properties' to 'false' to disable 2021-05-03 17:05:53.232  INFO 13128 --- [  restartedMain] .e.DevToolsPropertyDefaultsPostProcessor : For additional web related logging consider setting the 'logging.level.web' property to 'DEBUG' 2021-05-03 17:05:54.052  INFO 13128 --- [  restartedMain] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat initialized with port(s): 8090 (http) 2021-05-03 17:05:54.059  INFO 13128 --- [  restartedMain] o.apache.catalina.core.StandardService   : Starting service [Tomcat] 2021-05-03 17:05:54.059  INFO 13128 --- [  restartedMain] org.apache.catalina.core.StandardEngine  : Starting Servlet engine: [Apache Tomcat/9.0.39] 2021-05-03 17:05:54.130  INFO 13128 --- [  restartedMain] o.a.c.c.C.[Tomcat].[localhost].[/]       : Initializing Spring embedded WebApplicationContext 2021-05-03 17:05:54.130  INFO 13128 --- [  restartedMain] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 897 ms 2021-05-03 17:05:54.206  WARN 13128 --- [  restartedMain] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'userController': Unsatisfied dependency expressed through field 'userService'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'userServiceImpl': Unsatisfied dependency expressed through field 'userMapper'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'userMapper' defined in file [E:\idea-workspace\spring_demo_03\target\classes\com\jt\mapper\UserMapper.class]: Unsatisfied dependency expressed through bean property 'sqlSessionFactory'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'org.mybatis.spring.boot.autoconfigure.MybatisAutoConfiguration': Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.boot.context.properties.ConfigurationPropertiesBindException: Error creating bean with name 'mybatis-org.mybatis.spring.boot.autoconfigure.MybatisProperties': Could not bind properties to 'MybatisProperties' : prefix=mybatis, ignoreInvalidFields=false, ignoreUnknownFields=true; nested exception is org.springframework.boot.context.properties.bind.BindException: Failed to bind properties under 'mybatis.configuration' to org.apache.ibatis.session.Configuration 2021-05-03 17:05:54.210  INFO 13128 --- [  restartedMain] o.apache.catalina.core.StandardService   : Stopping service [Tomcat] 2021-05-03 17:05:54.221  INFO 13128 --- [  restartedMain] ConditionEvaluationReportLoggingListener :  Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled. 2021-05-03 17:05:54.234 ERROR 13128 --- [  restartedMain] o.s.b.d.LoggingFailureAnalysisReporter   :  *************************** APPLICATION FAILED TO START *************************** Description: Failed to bind properties under 'mybatis.configuration' to org.apache.ibatis.session.Configuration:     Reason: No converter found capable of converting from type [java.lang.String] to type [@org.springframework.boot.context.properties.NestedConfigurationProperty org.apache.ibatis.session.Configuration] Action: Update your application's configuration Process finished with exit code 0  

回答 120366
采纳率50%
4天前
  • 0

    回答

  • 6

    浏览

  @EnableConfigurationProperties(RedisProperties.class) @Configuration public class RedisConfiguration { /** * 提供jedis的bean */ @Bean public Jedis jedis(RedisProperties redisProperties){ return new Jedis(redisProperties.getHost(),redisProperties.getPort()); } } 这是使用 RedisProperties 这个bean,我没有注入却能使用是怎么回事?注释了@Bean就没有被自动注入了,与@Bean有关吗?

  • 1

    回答

  • 20

    浏览

这样输入完全的路径是可以访问的 只输入到项目名的时候会出错然后tt4定义的路径就没了 是什么问题呢是后台拦截的问题吗还是nginx配置有问题

  • 4

    回答

  • 17

    浏览

电脑上设计出脚本,电脑数据线连手机没用,电脑怎么才能让手机使进入自己设置的脚本里了。

  • 6

    回答

  • 32

    浏览

我日志中sql输出了正确的数据,但是返回的List<Object>只接收到每行查询结果的第一个值,这是什么问题呢 1.这个是我的xml文件语句 2.这个是我的语句在日志中输出的结果 2.这个是我将它装进List<object>的返回结果 请求大神们指点!

  • 1

    回答

  • 57

    浏览

maven项目中 pom.xml <?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>org.example</groupId> <artifactId>Spring</artifactId> <packaging>pom</packaging> <version>1.0-SNAPSHOT</version> <modules> <module>springMVC</module> </modules> <properties> <maven.compiler.source>8</maven.compiler.source> <maven.compiler.target>8</maven.compiler.target> </properties> <dependencies> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>4.13.2</version> <scope>test</scope> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-webmvc</artifactId> <version>5.3.6</version> </dependency> <dependency> <groupId>javax.servlet</groupId> <artifactId>javax.servlet-api</artifactId> <version>4.0.1</version> <scope>provided</scope> </dependency> <!-- https://mvnrepository.com/artifact/javax.servlet.jsp/javax.servlet.jsp-api --> <dependency> <groupId>javax.servlet.jsp</groupId> <artifactId>javax.servlet.jsp-api</artifactId> <version>2.3.3</version> <scope>provided</scope> </dependency> <dependency> <groupId>javax.servlet.jsp.jstl</groupId> <artifactId>jstl</artifactId> <version>1.2</version> </dependency> </dependencies> <build> <resources> <resource> <directory>src/main/resources</directory> <includes> <include>**/*.properties</include> <include>**/*.xml</include> </includes> <filtering>false</filtering> </resource> <resource> <directory>src/main/java</directory> <includes> <include>**/*.properties</include> <include>**/*.xml</include> </includes> <filtering>false</filtering> </resource> </resources> </build> </project> web.xml <?xml version="1.0" encoding="UTF-8"?> <web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_4_0.xsd" version="4.0"> <!-- 注册DispatcherServlet--> <servlet> <servlet-name>springmvc</servlet-name> <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class> <init-param> <param-name>contextConfigLocation</param-name> <param-value>classpath:springmvc-servlet.xml</param-value> </init-param> <load-on-startup>1</load-on-startup> </servlet> <!-- 匹配所有的请求:不包括jsp--> <!-- 匹配所有的请求:包括jsp--> <servlet-mapping> <servlet-name>springmvc</servlet-name> <url-pattern>/</url-pattern> </servlet-mapping> </web-app> springmvc-servlet.xml <?xml version="1.0" encoding="UTF-8"?> <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.xsd http://www.springframework.org/schema/mvc https://www.springframework.org/schema/mvc/spring-mvc.xsd"> <context:component-scan base-package="com.kai.controller"/> <mvc:default-servlet-handler/> <mvc:annotation-driven/> <!-- 视图解析器--> <bean class="org.springframework.web.servlet.view.InternalResourceViewResolver" id="internalResourceViewResolver"> <property name="prefix" value="/WEB-INF/jsp/"/> <property name="suffix" value=".jsp"/> </bean> </beans> HelloController.class package com.kai.controller; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.RequestMapping; /** * @author kai * @create 2021-05-01 5:57 */ @Controller public class HelloControlle{ @RequestMapping("/t2") public String test(Model model){ model.addAttribute("msg","Springmvc is running"); return "text"; } } hello.jsp <%@ page contentType="text/html;charset=UTF-8" language="java" %> <html> <head> <title>Title</title> </head> <body> ${msg} </body> </html> 网上说加一个lib文件夹在WEB-INF下,加了之后还是没用,这里有一行红字 不知道什么意思 这里是整个项目