springboot整合jsp,完成公交车站路线图
点赞再看,养成习惯 开发环境: jdk 8 intellij idea tomcat 8 mysql 5.7 maven 3.6 所用技术: springboot jsp 数据静态初始化 项目介绍 使用springboot整合jsp,在后端写入公交路线名称和详细站点,前端页面可条件查询具体的内容,如公交路线,公交名称,车俩信息等。 运行效果 前台用户端: 路线选择 路线详情 数据准备: BusData.txt 准备工作: pom.xml加入jsp模板引擎支持: <dependency> <groupId>org.apache.tomcat.embed</groupId> <artifactId>tomcat-embed-jasper</artifactId> <scope>provided</scope> </dependency> springboot配置jsp spring.mvc.view.prefix=/ spring.mvc.view.suffix=.jsp 重要代码: bus数据初始化 @PostConstruct private void initBusData(){ try{ File file = new File(BusMap.getClass().getResource("/").getPath()); FileReader fileReader = new