Initially I have 1 home page"index.html" and a work page"books.html" that uses bookservlet. and my web.xml looks like this:
<servlet>
<servlet-name>Book</servlet-name>
<servlet-class>BookServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>Book</servlet-name>
<url-pattern>/books</url-pattern>
</servlet-mapping>
Everything worked fine at this moment, I can go to "index.html" to see the hello message as well as use forms inside "books.html" to interact with servlets.
Then we were introduced to front controller pattern, now my web.xml looks like:
<servlet>
<servlet-name>FrontControllerServlet</servlet-name>
<servlet-class>FrontControllerServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>FrontControllerServlet</servlet-name>
<url-pattern>/*</url-pattern>
</servlet-mapping>
Since it intercepts everything including .html in the uri, I now can still work with the servlets when entering the right urls in browser but lost the ability to view nice looking "index.html" and "books.html" files, and I have to use Postman to send some requests instead of able to click a button to do so before using front controller pattern.
I have looked online and the most obvious solution I found was through a welcome page, however, that only gives me the access to "index.html" not "books.html". What do people do to solve this issue of losing access to html files?