Commit b989d18e by Patryk Czarnik

Dodanie obsługi JSP

parent d39ab7e6
......@@ -68,6 +68,20 @@
<artifactId>spring-security-test</artifactId>
<scope>test</scope>
</dependency>
<!-- dopisane zależności, aby działało JSP -->
<dependency>
<groupId>org.apache.tomcat.embed</groupId>
<artifactId>tomcat-embed-jasper</artifactId>
</dependency>
<dependency>
<groupId>jakarta.servlet.jsp.jstl</groupId>
<artifactId>jakarta.servlet.jsp.jstl-api</artifactId>
</dependency>
<dependency>
<groupId>org.glassfish.web</groupId>
<artifactId>jakarta.servlet.jsp.jstl</artifactId>
</dependency>
</dependencies>
<build>
......
......@@ -6,11 +6,9 @@ import org.springframework.web.bind.annotation.ResponseBody;
@Controller
public class RootController {
@GetMapping("/")
@ResponseBody
public String index() {
return "Strona główna";
return "spis_tresci.jsp";
}
@GetMapping("/hello")
......
<%@page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Sklep Spring</title>
</head>
<body>
<h1>Sklep Spring – spis treści</h1>
<p>Przykład obliczenia: ${2+3*4}</p>
<p><a href="hello">Hello world</a></p>
</body>
</html>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment