Home > front end >  Springboot how to access the HTML templates folder son
Springboot how to access the HTML templates folder son

Time:12-15

Springboot access HTML templates folder son, such as templates/index. The HTML
Templates/a/index. The HTML
Templates/b/index2. HTML
The first can be directly in the background by modelandview (" index.html ") access, but under the son file error said can't find, how to write in order to access to the second and third

CodePudding user response:

Modelandview (" a/index. The HTML ") try, springboot framework directly use return "of" a/index;

CodePudding user response:

Return "of" a/index; Why can't I

CodePudding user response:

Jump through the controller, for example,
A, templates/index. The HTML
 @ RequestMapping ("/")/request/path (localhost: 8080) 
Public String index1 () {
Return "index";
}

Second, templates/a/index. The HTML
 @ RequestMapping ("/ABC ")//request path (localhost: 8080/ABC) 
Public String index () {
Return "/a/index";
}

CodePudding user response:

CodePudding user response:

# 4 floor of the great god said to the
Return "/ABC/eee cske. HTML";
So return by the way,
  • Related