简体   繁体   中英

A question about how to deploy my sprinboot web application to tomcat8

I had a problem accessing the JSP file when I started the jar package with java-jar, but when I started the springboot project locally with the IDE IDEA, I couldn't access the JSP file, why?When I started in tomcat8,it cannot be accessed too.

Sorry, I update it in I have an problem about how to run a springboot project .

To deploy spring boot application in tomcat(Here you need to notice that spring boot evolves use of embedded tomcat) so you do not require to put manually jar in any tomcat folder .The best approach is run the below maven commands.

mvn clean package

As it successfully execute the maven command it will create a target folder in your webapp you will get a jar file in your target folder.

Now only you want to run your jar using command prompt

java -jar namefJar.jar

Now you will see your spring boot app will be working fine.

Once i had a similar problem and when i add the below dependency, it got fixed.

<dependency>
    <groupId>org.apache.tomcat.embed</groupId>
    <artifactId>tomcat-embed-jasper</artifactId>
</dependency>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM