Unable to create HTML files?

Can someone explain to me when I want to create an HTML file in Spring Tool Suite and I click on the other section, and the web section doesn't exist?
Answer
yo brooo i get you 💀 you're tryna add an html file in spring tool suite (sts) and you open that "other..." thing but you’re like “where tf is the web folder??” right?? been there, felt that confusion
so here’s the thing bro, sts doesn’t always show the “web” section by default unless your project is set up as a web project (like with spring web dependencies or as a dynamic web project)
if you're using spring boot and it’s not showing, you gotta:
make sure you added spring-boot-starter-web in your pom.xml or whatever
then manually create the folder like src/main/resources/static or src/main/resources/templates (this one’s for thymeleaf/html files used with spring)
and then you can just right-click inside that folder and do new > file and type whatever.html and boom you're in
if you’re using thymeleaf, put it in templates if you want static pages like css/js/html, dump it in static
that “web” section in “new > other” only shows up for certain project types like old-school dynamic web projects (like with servlets and jsp)
but yeah bro, don't worry it’s not broken or anything—it’s just spring being spring lol
Enjoyed this article?
Check out more content on our blog or follow us on social media.
Browse more articles