All Downloads are FREE. Search and download functionalities are using the official Maven repository.

de.otto.edison.status.controller.InternalController Maven / Gradle / Ivy

There is a newer version: 0.82.2
Show newest version
package de.otto.edison.status.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * Redirect requests to /internal to /internal/status.
 *
 * This can be disabled by setting edison.status.redirect-internal.enabled=false in your application.properties.
 *
 * Created by guido on 05.02.16.
 */
@Controller
@ConditionalOnProperty(name = "edison.status.redirect-internal.enabled", havingValue = "true", matchIfMissing = true)
public class InternalController {

    @Value("${server.context-path}")
    private String serverContextPath;

    @RequestMapping(value = "/internal")
    public void redirectToStatus(final HttpServletResponse response) throws IOException {
        response.sendRedirect(serverContextPath + "/internal/status");
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy