Quantcast
Channel: Recent Questions - Stack Overflow
Viewing all articles
Browse latest Browse all 12231

using Spring boot MVC able to view the jsp page while I am using LocalHost but getting 404 Not Found error when i am Deploying it as a jar

$
0
0

I am able to view my JSP form when I'm using local host but unable to do so when I have deployed it as jar. Unable to determine what is the primary cause.

I've already tried most of the solution found on the Internet like adding proper dependencies

<dependency><groupId>org.apache.tomcat.embed</groupId><artifactId>tomcat-embed-jasper</artifactId></dependency><dependency><groupId>javax.servlet</groupId><artifactId>jstl</artifactId><scope>provided</scope></dependency> 

and also saving it in the right directory src/main/resources/META-INF/resources/WEB-INF/jsp/but still unable to resolve it

My complete dependency

<?xml version="1.0" encoding="UTF-8"?>`My complete dependency`<project xmlns="http://maven.apache.org/POM/4.0.0"    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"><modelVersion>4.0.0</modelVersion><parent><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-parent</artifactId><version>2.7.6</version><relativePath /> <!-- lookup parent from repository --></parent><groupId>com.conacent.oracle</groupId><artifactId>testMvc</artifactId><version>0.0.1-SNAPSHOT</version><name>testMvc</name><description>Payment Transfer For Bank</description><properties><java.version>11</java.version></properties><dependencies><!--<dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-data-jpa</artifactId></dependency>--><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-web</artifactId></dependency><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-devtools</artifactId><scope>runtime</scope><optional>true</optional></dependency><!--    <dependency><groupId>com.oracle.database.jdbc</groupId><artifactId>ojdbc11</artifactId><scope>runtime</scope></dependency>--><dependency><groupId>org.projectlombok</groupId><artifactId>lombok</artifactId><optional>true</optional></dependency><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-test</artifactId><scope>test</scope></dependency><dependency><groupId>org.apache.tomcat.embed</groupId><artifactId>tomcat-embed-jasper</artifactId></dependency><dependency><groupId>javax.servlet</groupId><artifactId>jstl</artifactId><scope>provided</scope></dependency></dependencies><build><plugins><plugin><groupId>org.springframework.boot</groupId><artifactId>spring-boot-maven-plugin</artifactId><configuration><excludes><exclude><groupId>org.projectlombok</groupId><artifactId>lombok</artifactId></exclude></excludes></configuration></plugin></plugins></build></project>
server.port=8090` application.properties`spring.mvc.view.prefix=/WEB-INF/views/spring.mvc.view.suffix=.jsp

my controller

    @GetMapping("/get")`my controller`    public ModelAndView showLocationForm() {        ModelAndView mav = new ModelAndView();        mav.setViewName("locationForm");        System.out.println("hello world");        return mav;    }

Viewing all articles
Browse latest Browse all 12231

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>