Netbeans Spring Boot Initilizr project: Unable to see jsp content in web browser

278
January 29, 2018, at 3:14 PM

I am reading Spring in Action, 4th Edition by manning publications and Chapter 5 is about Spring Web App. I am trying to implement textbook example in Netbeans using Maven template Spring Boot Initilizr Project. (Examples by author use Gradle. I want to use Maven Project Management tool)

However when I am trying to see content in browser, I am getting "Whitelabel Error Page". Below is my project configuration. What should I do to get past the error in Web browser and see content present in home.jsp

WebConfig.java content:

@Configuration
@EnableWebMvc
@ComponentScan("spitter.web")
public class WebConfig extends WebMvcConfigurerAdapter {
    @Bean
        public ViewResolver viewResolver() {
        InternalResourceViewResolver resolver
            = new InternalResourceViewResolver();
        resolver.setPrefix("/WEB-INF/pages/");
        resolver.setSuffix(".jsp");
        resolver.setExposeContextBeansAsAttributes(true);
        return resolver;
    }
    @Override
    public void configureDefaultServletHandling(
            DefaultServletHandlerConfigurer configurer) {
        configurer.enable();
    }
}

home.jsp content:

<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ page session="false" %>
<html>
    <head>
        <title>Spittr</title>
        <link rel="stylesheet"
              type="text/css"
              href="<c:url value="/resources/style.css" />" >
    </head>
    <body>
        <h1>Welcome to Spittr</h1>
        <a href="<c:url value="/spittles" />">Spittles</a> |
        <a href="<c:url value="/spitter/register" />">Register</a>
    </body>
</html>

I am able to properly test @Test scripts present in Test Packages.

Rent Charter Buses Company
READ ALSO
What exactly is the leader used for in DelayQueue?

What exactly is the leader used for in DelayQueue?

I was trying to understand DelayQueue in javautil

183
Error:Execution failed for task &#39;:app:transformClassesWithDesugarForDebug&#39;

Error:Execution failed for task ':app:transformClassesWithDesugarForDebug'

I am trying to run an app that my team are developing, but android studio keeps saying this :

416
Is there a better way to pass many arguments to a controller&#39;s constructor and avoid too many arguments or initialization

Is there a better way to pass many arguments to a controller's constructor and avoid too many arguments or initialization

I read in one of the answers here in SO that Java Swing isn't fully in MVC patternI'm also new with using the MVC pattern and I code in Java Swing

171
Editing main method to test a method

Editing main method to test a method

I am trying to test my method belowThe code was provided and my task is to edit the main method so it will count the number of occurrence of the word in the file

202