spring-boot 新手入门 jsp 404

spring-boot  最近比较火,

但是也要有spring spring-mvc 等基础,他是将其他框架融合,便于快速开发



废话不说,

入门常见的问题,404 再不到路进

不知道,你是否忘记,web-inf 是一个保护文件,不能放在里买,如果要放在里面,则需要声明,为简单,我直接放在webapp 下的jsp文件夹里


The @RestController and @RequestMapping annotations


对于这两个的理解,这是官网上的,,也可以百度

RestController RequestMapping 直接放回数据

Controller  RequestMapping 放回资源文件



The first annotation on our Example class is @RestController. This is known as astereotype annotation. It provides hints for people reading the code, and for Spring,that the class plays a specific role. In this case, our class is a web @Controller soSpring will consider it when handling incoming web requests.

The @RequestMapping annotation provides “routing” information. It is telling Springthat any HTTP request with the path “/” should be mapped to the home method. The@RestController annotation tells Spring to render the resulting string directlyback to the caller.


上传一个可以运行的spring-boot jsp

spring-boot 开发文档

https://docs.spring.io/spring-boot/docs/current-SNAPSHOT/reference/htmlsingle/#using-boot-maven-without-a-parent




  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值