On the problem of website optimization

A personal blog-like website developed using javaweb, the home page needs to load a lot of things, such as articles, mood quotes similar to Weibo, latest comments, announcements, and broadcast pictures. I originally wanted to use freemarker, but I found that there were too many things and too much trouble, so I directly used jsp, but I encountered a new problem. Because you need to load a lot of things, but you don"t want to write too much java code in jsp, you just want to use el expressions to take values in jsp. But it is found that to do this, you have to access a servlet, before visiting the home page, but how can you access the domain name to enter the home page?
I mean, add a servlet, and my visit becomes www.xxxxx.com/servlet-name. What I want is to visit www.xxxxx.com.
. Also, how do you handle the home page? jsp feels too inefficient. If you use ajax, you have to write a lot of ajax requests.

Mar.13,2021

1 Servlet can be hung on the root of the
2 your needs, you can also consider whether it is possible to achieve through filter, so that there is no need to hang Servlet
3 home page with freemarker and jsp can, personal preference freemarker, with ajax is not appropriate, unless you do not need search engine index.


when visiting /, the content of index is returned

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1bbf11a-2fbd1.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1bbf11a-2fbd1.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?