springboot(三 单独将controller放一个包下)
来源:互联网 发布:学python工作后累不累 编辑:程序博客网 时间:2024/06/05 19:35
springboot的入口
package com.example;import org.springframework.boot.SpringApplication;import org.springframework.boot.autoconfigure.SpringBootApplication;import org.springframework.boot.builder.SpringApplicationBuilder;import org.springframework.boot.web.support.SpringBootServletInitializer;import org.springframework.context.annotation.Configuration;@SpringBootApplicationpublic class DatasourcesApplication {public static void main(String[] args) {SpringApplication.run(DatasourcesApplication.class, args);}}
controller类
package com.example.controller;import org.springframework.web.bind.annotation.RequestMapping;import org.springframework.web.bind.annotation.ResponseBody;import org.springframework.web.bind.annotation.RestController;@RestControllerpublic class Hello {//连一个数据库@RequestMapping(value="/hello")//@ResponseBody public String data1(){ System.err.println("进入controller"); return "hello"; }}这里需要注意 这两个位置 contrller在入口包里或者包下,否则访问不了
阅读全文
0 0
- springboot(三 单独将controller放一个包下)
- 如何将一个SpringBoot简便地打成一个war包(亲测有效)
- 如何将一个SpringBoot简便地打成一个war包(亲测有效)
- c/c++实现将cef的一堆dll单独放在一个文件夹,与程序exe目录区分开
- 使用MVC框架中要注意的问题(二):将Model和Controller单独用一个项目设计
- SpringBoot入门(三)Controller的使用
- maven打包:将webapp下的classes文件打包到单独的jar包中
- maven打包:将webapp下的classes文件打包到单独的jar包中
- SpringBoot之Controller(B)
- Linux下如何将命令行的结果保存到一个单独的文件
- 将分页作为一个单独的控件
- 将分页作为一个单独的控件
- springboot controller
- springboot-Controller
- SpringBoot Controller
- 如何将eclipse下的引用的jar文件放在包内
- c++将一个文件夹下的所有文件读取出来放在一个文件中
- intellij下将springboot项目打成war包发布到远程tomcat服务器上
- nginx lua 配置
- 随机森林算法 连接超时问题;
- linux常用命令
- 将图像数据存储进纹理的几种方法
- Atom快捷键
- springboot(三 单独将controller放一个包下)
- echarts的小案例
- idea mac 修改签名
- Java 深入学习(13) —— final 关键字
- SpringSecurity2 session超时跳转登陆界面
- docker部署shipyard容器管理工具
- shell脚本中与文件判断相关的指令
- 28. Implement strStr()
- Android 在线下载更新App 下载完成安装APK(兼容Android7.0)