I'm getting the following error when running my project using Spring Tool Suite,
But in case my problem is I have already added the appropriate dependencies to pom.XML
file. So what could be the problem?
My pom.XML
file dependencies as follows,
<dependency>
<groupId>org.apache.tomcat.embed</groupId>
<artifactId>tomcat-embed-jasper</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
<version>2.1.3.RELEASE</version>
</dependency>
My controller ApplicationController.java
as follows,
package com.example.demo.controller;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
@Controller
public class ApplicationController {
@RequestMapping("/")
public String Welcome() {
return "welcomepage";
}
}
My vives are in src/main/webapp/WEB-INF/view/welcomepage.jsp
you can look the tree view below,
And I have already changed the application.properties
file as well. But still, I can't understand what is wrong.
My application.properties
file as follows,
spring.mvc.view.prefix=/WEB-INF/view/
spring.mvc.view.suffix=.jsp
I just print hello in My welcomepage.jsp
,
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="ISO-8859-1">
<title>Insert title here</title>
</head>
<body>
hello
</body>
</html>