blob: 2fdc6d9759d346202a98c96a48902faaef4be1b7 [file] [log] [blame]
/********************************************************************************
* Copyright (c) 2015-2018 Contributors to the Eclipse Foundation
*
* See the NOTICE file(s) distributed with this work for additional
* information regarding copyright ownership.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0.
*
* SPDX-License-Identifier: EPL-2.0
*
********************************************************************************/
package org.eclipse.mdm.application.logout;
import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
/**
* MDMLogoutServlet
*
* @author Sebastian Dirsch, Gigatronik Ingolstadt GmbH
*
*/
@WebServlet(name = "MDMLogoutServlet", urlPatterns = { "/mdm/logout" })
public class MDMLogoutServlet extends HttpServlet {
private static final long serialVersionUID = -2243639870075761399L;
@Override
protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
req.logout();
req.getSession().invalidate();
resp.sendRedirect(req.getContextPath());
}
}