How to make it load the complete welcome-file url

1

In web.xml it is mapped like this:

<welcome-file-list>
    <welcome-file>agendamento/index.xhtml</welcome-file>
</welcome-file-list>

When opening the application in the browser is opening right, but I need this url to be present because of a redirect in that index.

    
asked by anonymous 06.03.2014 / 15:02

1 answer

2

The welcome-file setting is not for redirects.

The idea is: when a user accesses an unmapped directory of your application, the web container will look in that directory for files with their names.

To redirect the user from the root of the application, create a filter or servlet mapping mapped to the root ( / ) that does this redirect 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 accessing /agendamento/ , simply leave the index.html file in the schedule folder and use the above configuration without specifying the directory.

    
06.03.2014 / 15:10