blob: 16c2ad1905ccd366d893576f3307b322f2b29ad5 [file] [log] [blame]
/*
* Copyright (c) 2020 Kentyou.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Kentyou - initial API and implementation
*/
package org.eclipse.sensinact.studio.web;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
/**
* @author RĂ©mi Druilhe
*/
public class IndexFilter implements Filter {
private final String alias;
IndexFilter(String alias) {
this.alias = alias;
}
public void init(FilterConfig filterConfig) throws ServletException {
}
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException {
((HttpServletResponse) response).sendRedirect(alias + "/index.html");
}
public void destroy() {
}
}