Spring boot
文章平均质量分 55
甘v果
这个作者很懒,什么都没留下…
展开
-
Spring Boot获取前端页面参数的几种方式总结
1.指定前端url请求参数名与方法参数名一致 举个例子,一个url请求http://localhost:8080/hello?name=xxx,在指定的控制器类上加上Controller注解,同时指定RequestMapping注解即可。 当请求路径参数与方法参数匹配上时会自动注入 启动主程序,访问浏览器出现下图,表明注入参数成功,这种方式一般是get请求 2.通过HttpServletRequest来获取前端页面参数 简单来说就是通过调用request的getParameter方法来获取参数。 比如访原创 2022-05-10 14:40:36 · 4447 阅读 · 0 评论 -
spring boot 启动类 快捷入口
项目场景: 为了减少项目启动后经常输入端口号的操作,结合配置参数在启动时新增链接地址 解决方案: 参数分析:application.getEnvironment().getProperty(“server.port”); 里的server.port就是对应配置类里的对应配置 public static void main(String[] args) throws UnknownHostException { //SpringApplication.run(CarHostApplication.cl原创 2022-05-07 05:15:04 · 293 阅读 · 0 评论 -
Failed to start bean ‘documentationPluginsBootstrapper’; nested exception is java.lang.NullPointerEx
项目场景: springboot 集成Swagger2启动报错 Failed to start bean ‘documentationPluginsBootstrapper’; nested exception is java.lang.NullPointerException 问题描述 org.springframework.context.ApplicationContextException: Failed to start bean 'documentationPluginsBootstrapper原创 2022-05-07 04:28:36 · 12543 阅读 · 5 评论