I have a small maven (indirectly through Netbeans 8.1 & tomcat setup)
And whenever I ran the project it opens the browser with a HelloWord on the root:
i.e the page on http://localhost:8084/
is:
<html>
<head>
<title>Start Page</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<h1>Hello World!</h1>
</body>
</html>
I've tried to create a servlet to replace it using:
@WebServlet(name = "HomeServlet", urlPatterns = {"/"})
however, it did not work as expected.
I.e. it still showed the same hello world on: http://localhost:8084
But it did mess with all the files on the root i.e http://localhost:8084/foo.css
was being handled by this servlet as well and getting its response.
So, my question is (actually two):
How can I change the contents of this page to something else ?
Or, at the very least (if the former is impossible): Can I use a permanent redirect on root path to avoid the user from seeing this page?
(i.e. http code 301) to move the user to http://localhost:8084/home