您好,欢迎来到三六零分类信息网!老站,搜索引擎当天收录,欢迎发信息

spring boot入门操作(一)

2025/3/9 4:01:00发布36次查看
spring boot入门操作创建helloworld新建maven project ,选择artifact id 为maven-archetype-quicktype
创建pom,在project中添加
<parent>     <groupid>org.springframework.boot</groupid>     <artifactid>spring-boot-starter-parent</artifactid>     <version>1.5.4.release</version> </parent>
在properties在添加
<java.version>1.8</java.version>
在dependencies里添加
<dependency>     <groupid>org.springframework.boot</groupid>     <artifactid>spring-boot-starter-web</artifactid> </dependency>
update maven
创建helloworldcontroller类
@restcontroller public class helloworldcontroller {     @requestmapping(/hello)     public string hello(){         return hello world!;     } }
编写启动类 app.java
@springbootapplication public class app  {     public static void main( string[] args )     {          system.out.println( console  hello world! );          springapplication.run(app.class, args);     }  }
浏览器输入localhost:8080/hello
以上就是spring boot入门操作(一)的详细内容。
该用户其它信息

VIP推荐

免费发布信息,免费发布B2B信息网站平台 - 三六零分类信息网 沪ICP备09012988号-2
企业名录 Product