I am in the same situation when my spring-loaded application (integration) does not support the static contents of the folder to show the interface on localhost: 8080. Frontend is developed in angular4, so ng build which generates files in the output path dir src / main / resources / static, but does not show any content. I made a controller specifically for serving index.html, but it seems that something is disabled for spring loading to understand what angular routing information and localhost are: 8080 just displays the returned string from my controller method βindex.htmlβ on the web -page. Below is index.html (I changed the default selector tag in the body, since the input component is the one I created and my main corner component is for the user interface, but still does not work, whether it's root or root):
<!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <title>Hello Test App</title> <base href="/"> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="icon" type="image/x-icon" href="favicon.ico"> </head> <body> <app-login></app-login> <script type="text/javascript" src="runtime.js"></script><script type="text/javascript" src="polyfills.js"></script><script type="text/javascript" src="styles.js"></script><script type="text/javascript" src="vendor.js"></script><script type="text/javascript" src="main.js"></script></body> </html>
Controller Code:
@RequestMapping("/") public String userInterface() { return "index.html"; }
Not sure if this matters, but this is a rake-based project developed by IntellijIdea, and the spring version of the download is org.springframework.boot:spring-boot-starter-web:2.0.2.RELEASE .
@Vizcaino - As you said, there is a simple trick-, does Intellijidea make a similar option for creating the source directory / folder? I created from the context menu β New β directory. But not sure if this is the same, wondering if this will cause my problem?
user6087439 03 Sep '18 at 2:23 2018-09-03 02:23
source share