Skip to content

Instantly share code, notes, and snippets.

@jayden-lee
Last active October 14, 2018 14:53
Show Gist options
  • Save jayden-lee/0fae492cf6321975b460d13a1ef34244 to your computer and use it in GitHub Desktop.
Save jayden-lee/0fae492cf6321975b460d13a1ef34244 to your computer and use it in GitHub Desktop.
Spring Boot with JSP
spring.mvc.view.prefix=/WEB-INF/jsp/
spring.mvc.view.suffix=.jsp
derendencies {
compile('javax.servlet:jstl')
compile("org.apache.tomcat.embed:tomcat-embed-jasper")
}
<%@ page language="java" contentType="text/html; charset=utf-8"
pageEncoding="utf-8" isELIgnored="false"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Spring Boot Application with JSP</title>
</head>
<body>
Hello, Spring Boot App
</body>
</html>
package com.jayden.demo.controller;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
@Controller
@RequestMapping("/hello")
public class HelloController {
@GetMapping
public String hello() {
return "hello";
}
}
<dependencies>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jstl</artifactId>
</dependency>
<dependency>
<groupId>org.apache.tomcat.embed</groupId>
<artifactId>tomcat-embed-jasper</artifactId>
</dependency>
</dependencies>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment