Can you help a tag look at the static resource path without looking at the controller

21 Views Asked by At

1 - Main Controller (MainController.java was created by moving /static/index.html to /template/index.html)

enter image description here

2 - index.html (This page is displayed normally. enter image description here

3 - LoginController.java (I checked that the controller was not called and that the for statement was not marked, and later I noticed that the above a-tags were pointing to /static/ rather than the controller when I looked at the error message.) enter image description here

4 - set bulid.gradle enter image description here

5 - application.properties file settings enter image description here

package structure enter image description here

-- Error message

Whitelabel Error Page This application has no explicit mapping for /error, so you are seeing this as a fallback.

Thu Mar 28 12:28:39 KST 2024 There was an unexpected error (type=Not Found, status=404).

No static resource login/loginPage.

org.springframework.web.servlet.resource.NoResourceFoundException: No static resource login/loginPage. at org.springframework.web.servlet.resource.ResourceHttpRequestHandler.handleRequest(ResourceHttpRequestHandler.java:585) ....

여기서 "No static resource login/loginPage. "

Just in case I saw the phrase login/loginPage is not a static resource

Favicon.ico under /static

Login 4

Login 4-1

I made it in index.html like this, and when I clicked on it, I found that favicon.ico popped up in a new window...:(

I want you to call the controller

Login 1

Login 1-1

I made it like this, but the spring boot seems to see this src/main/resources/static/ sub.. :(

I think I should not only create a mapping address on the controller, but also set the a-tags to look at the controller's address, not the static resource, so could you help me

I found out, so I Google it several times and try MvcConfiguration (config setting) and it doesn't seem to be a problem with this..

I tried config setting, Google search, and creating and executing new projects.

0

There are 0 best solutions below