Я хочу, чтобы отобразить индекс HTML в разных в 2-х случаях:Как изменить dynamiclly приветственного-файл в web.xml в соответствии с запросом входящего ROOT
Признайте, если запрос пришел с мобильного устройства, чтобы перенаправить прием -file к mobile.html,
Если запрос пришел с веб-страницы перенаправления на второй радушны-файл web_index.html
Как я могу сделать логики, приветственные фАЙЛА ВЫБРАТЬ ??
<welcome-file-list> <welcome-file>mobile.html</welcome-file> <welcome-file>web_index.html</welcome-file>
P.S Я использую Java EJB - Tomcat
Мой web.xml является следующее:
<?xml version="1.0" encoding="ISO-8859-1"?>
<web-app xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
version="3.0">
<security-constraint>
<display-name>Entire Application</display-name>
<web-resource-collection>
<web-resource-name>Secured area</web-resource-name>
<url-pattern>/*</url-pattern>
</web-resource-collection>
<auth-constraint>
<role-name>superuser</role-name>
</auth-constraint>
<user-data-constraint>
<transport-guarantee>CONFIDENTIAL</transport-guarantee>
</user-data-constraint>
</security-constraint>
<security-constraint>
<display-name>administration</display-name>
<web-resource-collection>
<web-resource-name>administration area</web-resource-name>
<url-pattern>/admin.html</url-pattern>
</web-resource-collection>
<auth-constraint>
<role-name>superuser</role-name>
<role-name>admin</role-name>
</auth-constraint>
<user-data-constraint>
<transport-guarantee>CONFIDENTIAL</transport-guarantee>
</user-data-constraint>
</security-constraint>
<security-role>
<role-name>superuser</role-name>
</security-role>
<session-config>
<session-timeout>60</session-timeout>
<cookie-config>
<http-only>true</http-only>
<path>/</path>
</cookie-config>
<tracking-mode>COOKIE</tracking-mode>
</session-config>
<security-constraint>
<display-name>Unsecured</display-name>
<web-resource-collection>
<web-resource-name>Unsecured area</web-resource-name>
<url-pattern>/*</url-pattern>
</web-resource-collection>
<user-data-constraint>
<transport-guarantee>CONFIDENTIAL</transport-guarantee>
</user-data-constraint>
</security-constraint>
<filter>
<filter-name>LogoutFilter</filter-name>
<filter-class>com.ngsoft.tt.ROOT.filters.LogoutFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>LogoutFilter</filter-name>
<url-pattern>/logout</url-pattern>
</filter-mapping>
<login-config>
<auth-method>FORM</auth-method>
<realm-name>TitanLogin</realm-name>
<form-login-config>
<form-login-page>/login.html</form-login-page>
<form-error-page>/error.html</form-error-page>
</form-login-config>
</login-config>
<welcome-file-list>
<welcome-file>welcome.html</welcome-file>
</welcome-file-list>
</web-app>
Спасибо, я проверю, что о web.xml, как я должен настроить Это ? и как установить приветственный файл ??? – VitalyT
Установите приветственный файл в список приветственных файлов web.xml ' index.html welcome-file>' Обычное имя 'index.html', но вы можете использовать имя, которое вы хотите –
pedrofb