Web App using Spring Boot

Telusko · 280K views · 2018 · 14:56

Open on YouTube

Web developmentSoftware practice, open source & careerstutorialdated

Why Stack Overflow recommends it

Stack Overflow users link it when answering why JSP pages fail to render in a Spring Boot app, since it shows the working step-by-step JSP and Tomcat Jasper configuration.

Recommended by 2 people across 3 different months, 2018 to 2018.

What it is

A roughly 15-minute tutorial from Navin Reddy of Telusko that walks through building a simple Spring Boot web application, including configuring JSP views with the embedded Tomcat. It is part of a longer Spring Boot MVC playlist.

What people said

Recommends Alien · 2018-07 · Stack Overflow · on “How do I load the jsp pages using Spring MVC framework for a Spring Boot application? I get null pointer exception”

By default spring boot doesn't support JSPs so you need to add the support like below. add tomcat jasper dependency in your pom.xml <!-- [LINK] --> <dependency> <groupId>org.apache.tomcat</groupId> <artifactId>tomcat-jasper</artifactId> <version>8.5.31</version> </dependency> **Here version should be same which your spring boot internal tomcat uses(for me it was 8.5.31) by adding this dependency spring boot will get to know that how to convert a jsp into servlet. The jsp page should be inside webapp directory. i am attaching an image for your reference regarding directory structure and video link for step by step configuration. [this video] [LINK]

Recommends Alien · 2018-11 · Stack Overflow · on “SpringBoot cannot provide jsp files in webapp Folder”

Ensure that jasper dependency and embedded tomcat dependency versions should be same otherwise it will be an issue. Also try putting a jsp page outside itself like src/main/webapp/abc.jsp and remove view resolver and return directly like "abc.jsp" and see if that works. see this [this video] at 7:30

Recommends paulsm4 · 2018-12 · Stack Overflow · on “Having issue displaying JSP page in Spring-MVC”

It turns out that it's non-trivial to get JSPs to work with Spring Boot. It also turns out that there are significant changes between Spring Boot 1.x (which most of the tutorials for Spring Boot/JSP were written to) and Spring Boot 2.x. I found these resources helpful: Navin Reddy: Web App Using Spring Boot [this video] MKYong: Spring Boot Hello World Example – JSP [LINK] I got JSP working with both Spring Boot 1.x and 2.x, with both Maven and Gradle. My project is here on GitHub: [LINK] These are the highlights of what I needed to do: I created my starter project with Eclipse STS. It was important to specify "War" packaging (vs. the default "Jar") I added the following dependencies in my build.g

Cites Ikenna Shonowo · 2018-06 · Stack Overflow · on “Error on a Simple Spring Boot Web Application”

I am following the Telusko Spring Boot tutorial (my code is at [LINK] ). My project is supposed to print "Hello" on the console and display the message "I love Jesus." in home.jsp. It prints "Hello" but gives the error below when I browse to [LINK] Hello 2018-06-17 16:49:47.683 ERROR 1260 --- [nio-8080-exec-3] o.a.c.c.C.[.[localhost].[/].[jsp] : Servlet.service() for servlet [jsp] threw exception java.lang.ClassNotFoundException: org.apache.jsp.pages.home_jsp at java.net.URLClassLoader.findClass(Unknown Source) ~[na:1.8.0_101] at org.apache.jasper.servlet.JasperLoader.loadClass(JasperLoader.java:129) ~[tomcat-jasper-8.5.31.jar:8.5.31] at org.apache.jasper.servlet.JasperLoader.loadClass(Jaspe