The configuration welcome-file
does not serve to make redirects.
The idea is: when a user accesses an unmapped directory of your application, the web container will search that directory for files with their respective names.
To redirect the user from the root of the application, create a filter or mapped Servlet at the root (/
) that makes this redirection via code.
Or, move the file index.html
to the root of your application and change the setting to:
<welcome-file-list>
<welcome-file>index.xhtml</welcome-file>
</welcome-file-list>
Finally, redirect from there.
On the other hand, if you want to redirect the user you access /agendamento/
, simply leave the file index.html
in the schedule folder and use the above setting without specifying the directory.
Very well explained, thanks man.
– DudisRoyer