The springboot of Java EE

Source: Internet
Author: User

1.Springboot

A. Definition: Spring Boot is a new framework provided by the pivotal team designed to simplify the initial construction and development of new spring applications

B. Contractual directory structure: (Maven resource file directory/src/java/resources)

Spring-boot Project static file directory:/src/java/resources/static (usually put IMG, CSS, JS, etc.)

Spring-boot project template file directory:/src/java/resources/templates (general HTML file)

1. Role

In A.controller

    @GetMapping ("/")    // input path http://127.0.0.1:8080/access to     Public String Index () {        return ' index ';    }    @GetMapping ("/loginpapge")    public  String loginpapge () {          return "Login";    }

In b.html

<!DOCTYPE HTML><HTMLLang= "en"xmlns:th= "http://www.thymeleaf.org"><Head>    <MetaCharSet= "UTF-8"/>    <title>Title</title></Head><Body>you are welcome:<spanTh:text= "${session.user.getusername ()}"></span>    <Table>        <TR>            <th>Id</th>            <th>Name</th>            <th>Password</th>            <th>State</th>        </TR>        <TRTh:each= "User,userstat: ${users}">            <TDTh:text= "${user.userid}"></TD>            <TDTh:text= "${user.username}"></TD>            <TDTh:text= "${user.userpwd}"></TD>            <TDTh:text= "${user.usertype}"></TD>        </TR>    </Table></Body></HTML>

C. If you need to use spring Data Jpa, you need to configure APPLICATION.YML in/src/java/resources

Spring:  thymeleaf:    cache:false  DataSource:    username:root    url:jdbc:mysql://127.0.0.1:3306/ j135    driver-class-name:com.mysql.jdbc.driver    password:admin  JPA:    show-sql:true    Database-platform:org.hibernate.dialect.mysql5dialect

    

The springboot of Java EE

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.