Skip to content

skrityak/spring-boot-jsp

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Spring Boot 2 with JSP pages

Technologies: Spring-Boot with WEB, JPA, JAXRS, JSP and Boostrap css/js framework.

Reference: https://github.com/spring-projects/spring-boot/tree/v1.5.8.RELEASE/spring-boot-samples/spring-boot-sample-web-jsp

Forked from: https://github.com/rigels02/spring-boot-jsp and made the following changes:-

  • JDK14
  • Upgraded to springboot2 and use BOM style
  • Use Hibernate bytecode optimization
  • Use Lombok
  • Pre-compiled JSP

Steps

  1. Create Spring-Boot project using Spring-Boot Initializer with

     H2, MySql, Jpa, WEB support
    
  2. In src/main folder create webapp folder.

    a. Inside webapp create WEB-INF/jsp and static folders

    b. You can delete static and templates folders from resources folder.

    c. add info for jsp files prefix, suffix in application.properties

     spring.mvc.view.prefix=/WEB-INF/jsp/
     spring.mvc.view.suffix=.jsp
    
  3. put

    <packaging>war</packaging>

    and for JSP and jstl support add additional dependencies in pom.xml

     <dependency>
         <groupId>org.apache.tomcat.embed</groupId>
         <artifactId>tomcat-embed-jasper</artifactId>
     </dependency>
     <dependency>
         <groupId>jstl</groupId>
         <artifactId>jstl</artifactId>
         <version>1.2</version>
     </dependency>
    
  4. add necessary services, controllers etc.

  5. Run

    mvn spring-boot:run

    - OR -
    

    mvn clean package

    java -jar SpringBootJSP_2.war

About

Spring Boot with JSP Example

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 90.9%
  • Java 9.1%