File tree Expand file tree Collapse file tree 2 files changed +16
-0
lines changed
java/org/cerberus/core/config/cerberus Expand file tree Collapse file tree 2 files changed +16
-0
lines changed Original file line number Diff line number Diff line change 2323import jakarta .servlet .*;
2424import jakarta .servlet .http .HttpSessionEvent ;
2525import jakarta .servlet .http .HttpSessionListener ;
26+ import org .apache .logging .log4j .LogManager ;
27+ import org .apache .logging .log4j .Logger ;
2628import org .cerberus .core .config .webmvc .WebMvcConfiguration ;
2729import org .springframework .web .WebApplicationInitializer ;
2830import org .springframework .web .context .ContextLoaderListener ;
3840 */
3941public class WebAppInitializer implements WebApplicationInitializer {
4042
43+ private static final Logger LOG = LogManager .getLogger (WebAppInitializer .class );
44+
4145 @ Override
4246 public void onStartup (ServletContext servletContext ) throws ServletException {
4347
48+ LOG .info ("========================================" );
49+ LOG .info (">>> WebAppInitializer.onStartup() called" );
50+ LOG .info ("========================================" );
51+
4452 // Single shared Spring context for both root beans and MVC beans.
4553 // Avoids the classic root/servlet context split that causes issues with Spring Security.
4654 AnnotationConfigWebApplicationContext context = new AnnotationConfigWebApplicationContext ();
Original file line number Diff line number Diff line change 2323<%@page import =" org.springframework.context.ApplicationContext" %>
2424<%@page import =" org.cerberus.core.database.IDatabaseVersioningService" %>
2525
26+ <%-- Forcer l'authentification : si non connecté, rediriger vers Homepage.jsp pour passer par Spring Security --%>
27+ <%
28+ if (request. getUserPrincipal() == null ) {
29+ response. sendRedirect(request. getContextPath() + " /Homepage.jsp" );
30+ return ;
31+ }
32+ % >
33+
2634<%@page contentType =" text/html" pageEncoding =" UTF-8" %>
2735<!DOCTYPE html>
2836<html class =" h-full" >
You can’t perform that action at this time.
0 commit comments