My Spring Boot appliation will basically consist of two main "modules":
- A "Web" Module that consists of static HTML pages, available to the public (unauthenticated/anonymouse users); and
- An "App" Module that consists of a number of dynamic pages, each of which require (Spring Security-based) authentication to access
The basic app structure is:
index.html: Homepage, mapped fromhttp://localhost:8080/about.html: About page, mapped fromhttp://localhost:8080/aboutcontact.html: Contact page, mapped fromhttp://localhost:8080/contactlogin.html: Login page, mapped fromhttp://localhost:8080/logindashboard.html: Dashboard/landing page you get to after logging in, mapped fromhttp://localhost:8080/account- All other pages under
http://localhost:8080/account/*will be MVC/dynamic pages with typical@RequestMappingmappings
What is not clear to me is, for the static ("public web") HTML pages, do I:
- Just use standard controller-based
@RequestMappingsthat render some Thymeleaf/Handlebars template (which simply has no data model since the content is static)? Or do I: - Treat these pages as static content (same as CSS/JS) and serve them as static content as Spring Boot prescribes? If this is the correct option, then how do I achieve the correct URL mappings (so, for example, users can just go to
http://localhost:8080/contactinstead ofhttp://localhost:8080/contact.html)?