This is a quick question, but I could not find a quick answer. Now I have a BaseServlet servlet when a user requests any of the following links:
host host/ host/BaseServlet
It should always link to the same servlet and redirect to the home page.
When i install
@WebServlet({"/BaseServlet", ""})
Only
host/ host/BaseServlet
work
If i installed
@WebServlet({"/BaseServlet", "", "/"})
BaseServlet will be queried continuously in a loop ...
Why?
Edit: BaseServlet makes forward to index.html hidden in the WEB-INF folder and that it is.
getServletContext().getRequestDispatcher("/WEB-INF/index.html").forward(request,response);
The servlet specification says: "A string containing only the / character indicates the" servlet "by default of the application." Therefore, I want BaseServlet to be my default. Why is this not working?
kakacii
source share