diff --git a/.classpath b/.classpath index 2663538..c415fe0 100644 --- a/.classpath +++ b/.classpath @@ -13,7 +13,6 @@ - diff --git a/README.md b/README.md index c7db30f..f74e138 100644 --- a/README.md +++ b/README.md @@ -13,9 +13,17 @@ Kiss4web builds on: - KissDispatcher: call the good Java Servlet for each HTTP request, - Xidyn: a template solution to dynamize HTML sources. +## Author + +Lead developer: Christian Pierre MOMON + +## License + +Kiss4web is released under the GNU LGPL license. + ## Developing environment -Kiss4web-demo project uses strictly Eclipse Kepler, Java 6, GIT. +Kiss4web project uses strictly Eclipse 4.29, Java 17, tomcat 10.1 and Git. ## Build @@ -26,7 +34,109 @@ Kiss4web uses Ant and generates a kiss4web-x.y.z folder which contains: - x-core.jar : only compiled class without any library. - x-core-source.jar : sources. +## Dependencies -# License +The kiss4web jar requires: +- commons-io +- commons-lang3 +- devinsy-strings -Kiss4web is released under the GNU LGPL license. \ No newline at end of file +## Usages + +``` +B --> FooAppLauncher -------------------------> FooApp + [ServletContextListener] [Singleton] + | + | setMode(Mode.OPEN) + \ / +A --> Kiss4webLauncher ----setMode(Mode.OPEN)---> Kiss4web + [ServletContextListener] [Singleton] +``` + +KissDispatcher is initialized with Mode.APP_INIT. + +### Usage A: default + +The easier way, in case you have no application initialization step. The Kiss4webLauncher set a default log4j2 configuration and set the KissDispatcher to Mode.OPEN state with a default set of hooks. + +Edit `…/WebContent/WEB-INF/web.xml` : +``` + + fr.devinsy.kiss4web.Kiss4webLauncher + + + Application dispatcher + fr.devinsy.kiss4web.dispatcher.KissDispatcher + + webClassesRootPackage + website + + 1 + + + Application dispatcher + /* + +``` + +You can create …/WebContent/WEB-INF/log4j2.properties: +``` +# Log configuration +# ################# + +# priority setting: DEBUG < INFO < WARN < ERROR +name = Log4j2 Properties Config +status = ERROR +dest = err + +# Logger settings. +rootLogger.level = INFO +rootLogger.appenderRefs = a, b +rootLogger.appenderRef.a.ref = CONSOLE +rootLogger.appenderRef.b.ref = LOGFILE + +logger.statoolinfos.name = fr.devinsy.statoolinfos +logger.statoolinfos.level = INFO + +logger.xidyn.name = fr.devinsy.xidyn +logger.xidyn.level = WARN + +# Appenders settings. +appenders = CONSOLE, LOGFILE + +appender.CONSOLE.type = Console +appender.CONSOLE.name = CONSOLE +appender.CONSOLE.layout.type = PatternLayout +appender.CONSOLE.layout.pattern = %d{ISO8601} - FooApp [%-5p] %34.34c.%25M - %m%n + +appender.LOGFILE.type = File +appender.LOGFILE.name = LOGFILE +appender.LOGFILE.filename = /srv/fooapp/rslisi.log +appender.LOGFILE.layout.type = PatternLayout +appender.LOGFILE.layout.pattern = %d{ISO8601} - FooApp [%-5p] %34.34c.%25M - %m%n +``` + +### Usage B: custom init + +If you want manage an application initialization step, do not use the Kiss4webLauncher as class listener. Create your own FooAppLauncher and make it calls `Kiss4web.instance().setMode(Mode.OPEN)` when the init step is over. + + +Edit `…/WebContent/WEB-INF/web.xml` : +``` + + org.foo.app.FooAppLauncher + + + Application dispatcher + fr.devinsy.kiss4web.dispatcher.KissDispatcher + + webClassesRootPackage + website + + 1 + + + Application dispatcher + /* + +``` diff --git a/lib/servlet-api.jar b/lib/servlet-api.jar deleted file mode 100644 index dd326d3..0000000 Binary files a/lib/servlet-api.jar and /dev/null differ diff --git a/lib/tomcat10-servlet-api-10.1.16-sources.zip b/lib/tomcat10-servlet-api-10.1.16-sources.zip new file mode 100644 index 0000000..b607d5e Binary files /dev/null and b/lib/tomcat10-servlet-api-10.1.16-sources.zip differ diff --git a/lib/tomcat10-servlet-api-10.1.16.jar b/lib/tomcat10-servlet-api-10.1.16.jar new file mode 100644 index 0000000..90d97f6 Binary files /dev/null and b/lib/tomcat10-servlet-api-10.1.16.jar differ diff --git a/lib/tomcat9-servlet-api-9.0.31-sources.jar b/lib/tomcat9-servlet-api-9.0.31-sources.jar deleted file mode 100644 index 2fc724b..0000000 Binary files a/lib/tomcat9-servlet-api-9.0.31-sources.jar and /dev/null differ diff --git a/lib/tomcat9-servlet-api-9.0.31.jar b/lib/tomcat9-servlet-api-9.0.31.jar deleted file mode 100644 index 01e422e..0000000 Binary files a/lib/tomcat9-servlet-api-9.0.31.jar and /dev/null differ diff --git a/src/fr/devinsy/kiss4web/CookieHelper.java b/src/fr/devinsy/kiss4web/CookieHelper.java index 5ee9dc1..bb76a6d 100644 --- a/src/fr/devinsy/kiss4web/CookieHelper.java +++ b/src/fr/devinsy/kiss4web/CookieHelper.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2006-2021 Christian Pierre MOMON + * Copyright (C) 2006-2023 Christian Pierre MOMON * * This file is part of Kiss4web. * @@ -20,26 +20,26 @@ package fr.devinsy.kiss4web; import java.io.UnsupportedEncodingException; -import javax.servlet.http.Cookie; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import jakarta.servlet.http.Cookie; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; + /** * The Class CookieHelper. */ public class CookieHelper { - private static final Logger logger = LoggerFactory.getLogger(CookieHelper.class); - public enum Scope { HTTP_AND_HTTPS, HTTPS_ONLY } + private static final Logger logger = LoggerFactory.getLogger(CookieHelper.class); + /** * Builds the cookie. * diff --git a/src/fr/devinsy/kiss4web/EnvironmentInformation.java b/src/fr/devinsy/kiss4web/EnvironmentInformation.java index 494854b..d640346 100644 --- a/src/fr/devinsy/kiss4web/EnvironmentInformation.java +++ b/src/fr/devinsy/kiss4web/EnvironmentInformation.java @@ -80,11 +80,11 @@ public class EnvironmentInformation try { - result = (String) this.environment.lookup("kiss4web.log4j.path"); + result = (String) this.environment.lookup("kiss4web.log4j2.path"); } catch (NamingException exception) { - throw new ConfigurationException("Context configuration error on log4j path."); + throw new ConfigurationException("Context configuration error on log4j2 path."); } // diff --git a/src/fr/devinsy/kiss4web/Kiss4web.java b/src/fr/devinsy/kiss4web/Kiss4web.java index cf05cf7..76f095c 100644 --- a/src/fr/devinsy/kiss4web/Kiss4web.java +++ b/src/fr/devinsy/kiss4web/Kiss4web.java @@ -50,8 +50,8 @@ public class Kiss4web { INIT, INIT_FAILED, - APPLICATION_INIT, - APPLICATION_INIT_FAILED, + APP_INIT, + APP_INIT_FAILED, OPEN, MAINTENANCE, FATAL, @@ -78,7 +78,7 @@ public class Kiss4web try { // - this.mode = Mode.INIT; + setMode(Mode.INIT); // currentLog = "Kiss4web"; @@ -96,8 +96,8 @@ public class Kiss4web // // - setMode(Mode.APPLICATION_INIT); - logInit("set APPLICATION INIT mode", "PASSED"); + setMode(Mode.APP_INIT); + logInit("set APP INIT mode", "PASSED"); // currentLog = "Kiss4web"; @@ -145,6 +145,12 @@ public class Kiss4web switch (mode) { case INIT: + { + if (this.mode == null) + { + this.mode = Mode.INIT; + } + } break; case INIT_FAILED: @@ -159,7 +165,7 @@ public class Kiss4web } break; - case APPLICATION_INIT: + case APP_INIT: { if (this.mode == Mode.INIT) { @@ -171,9 +177,9 @@ public class Kiss4web } break; - case APPLICATION_INIT_FAILED: + case APP_INIT_FAILED: { - if (this.mode == Mode.APPLICATION_INIT_FAILED) + if (this.mode == Mode.APP_INIT) { this.mode = mode; HookRegister hooks = new HookRegister("Application Init failed"); @@ -185,19 +191,22 @@ public class Kiss4web case OPEN: { - this.mode = mode; + if ((this.mode == Mode.INIT) || (this.mode == Mode.APP_INIT)) + { + this.mode = mode; - HookRegister hooks = new HookRegister("Open"); - hooks.register(new BlankHook()); - hooks.register(new RootHook()); - hooks.register(new LongURLHook()); - hooks.register(new FolderHook()); - hooks.register(new ShortURLHook()); - hooks.register(new XHTMLHook()); - hooks.register(new WebContentHook()); - hooks.register(new WebInfHook()); + HookRegister hooks = new HookRegister("Open"); + hooks.register(new BlankHook()); + hooks.register(new RootHook()); + hooks.register(new LongURLHook()); + hooks.register(new FolderHook()); + hooks.register(new ShortURLHook()); + hooks.register(new XHTMLHook()); + hooks.register(new WebContentHook()); + hooks.register(new WebInfHook()); - KissDispatcher.setHookRegister(hooks); + KissDispatcher.setHookRegister(hooks); + } } break; diff --git a/src/fr/devinsy/kiss4web/Kiss4webLauncher.java b/src/fr/devinsy/kiss4web/Kiss4webLauncher.java index 37f24e8..eab016f 100644 --- a/src/fr/devinsy/kiss4web/Kiss4webLauncher.java +++ b/src/fr/devinsy/kiss4web/Kiss4webLauncher.java @@ -1,28 +1,26 @@ -/* - * Copyright (C) 2021-2023 Christian Pierre MOMON +/** + * Copyright (C) 2013-2023 Christian Pierre MOMON * - * This file is part of Juga, simple key value database. + * This file is part of Kiss4web. * - * Juga is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as - * published by the Free Software Foundation, either version 3 of the - * License, or (at your option) any later version. + * Kiss4web is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * Juga is distributed in the hope that it will be useful, + * Kiss4web is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. + * GNU Lesser General Public License for more details. * - * You should have received a copy of the GNU Affero General Public License - * along with Juga. If not, see . + * You should have received a copy of the GNU Lesser General Public License + * along with Kiss4web. If not, see */ package fr.devinsy.kiss4web; import java.io.File; import javax.naming.ConfigurationException; -import javax.servlet.ServletContext; -import javax.servlet.ServletContextEvent; import org.apache.commons.lang3.StringUtils; import org.apache.logging.log4j.core.config.Configurator; @@ -30,10 +28,19 @@ import org.apache.logging.log4j.core.config.DefaultConfiguration; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import fr.devinsy.kiss4web.Kiss4web.Mode; +import jakarta.servlet.ServletContext; +import jakarta.servlet.ServletContextEvent; +import jakarta.servlet.ServletContextListener; + /** - * The Class JugaWebLauncher. + * The Class Kiss4WebLauncher. + * + * The Context element represents a web application. If you have implemented a + * Java object that needs to know when this Context is started or stopped, you + * can declare it by nesting a Listener element inside this element. */ -public class Kiss4webLauncher implements javax.servlet.ServletContextListener +public class Kiss4webLauncher implements ServletContextListener { private static Logger logger = LoggerFactory.getLogger(Kiss4webLauncher.class); @@ -45,13 +52,17 @@ public class Kiss4webLauncher implements javax.servlet.ServletContextListener { } - /* (non-Javadoc) - * @see javax.servlet.ServletContextListener#contextInitialized(javax.servlet.ServletContextEvent) + /** + * {@inheritDoc} */ @Override public void contextInitialized(final ServletContextEvent event) { - launch(event.getServletContext()); + System.out.println("========= KISS4WEB WEBAPP LAUNCHING… =========="); + ServletContext context = event.getServletContext(); + initLogger(context.getRealPath("/")); + Kiss4web.instance().setMode(Mode.OPEN); + System.out.println("========= KISS4WEB WEBAPP LAUNCHED =========="); } /** @@ -113,10 +124,5 @@ public class Kiss4webLauncher implements javax.servlet.ServletContextListener */ public void launch(final ServletContext context) { - System.out.println("========= KISS4WEB WEBAPP LAUNCHING… =========="); - - initLogger(context.getRealPath("/")); - Kiss4web.instance(); - System.out.println("========= KISS4WEB WEBAPP LAUNCHED =========="); } } diff --git a/src/fr/devinsy/kiss4web/Page.java b/src/fr/devinsy/kiss4web/Page.java index 82a4dd9..fdac8df 100644 --- a/src/fr/devinsy/kiss4web/Page.java +++ b/src/fr/devinsy/kiss4web/Page.java @@ -20,9 +20,9 @@ package fr.devinsy.kiss4web; import java.io.IOException; -import javax.servlet.ServletException; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; +import jakarta.servlet.ServletException; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; /** * The Class Page. diff --git a/src/fr/devinsy/kiss4web/Redirector.java b/src/fr/devinsy/kiss4web/Redirector.java index eb76f1e..eab148c 100644 --- a/src/fr/devinsy/kiss4web/Redirector.java +++ b/src/fr/devinsy/kiss4web/Redirector.java @@ -18,11 +18,11 @@ */ package fr.devinsy.kiss4web; -import javax.servlet.http.HttpServletResponse; - import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import jakarta.servlet.http.HttpServletResponse; + /** * The Class Redirector. */ diff --git a/src/fr/devinsy/kiss4web/SimpleSecurityAgent.java b/src/fr/devinsy/kiss4web/SimpleSecurityAgent.java index 753f60b..dc03fbc 100644 --- a/src/fr/devinsy/kiss4web/SimpleSecurityAgent.java +++ b/src/fr/devinsy/kiss4web/SimpleSecurityAgent.java @@ -18,14 +18,13 @@ */ package fr.devinsy.kiss4web; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - import org.apache.commons.codec.digest.DigestUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import fr.devinsy.strings.StringList; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; /** * The Class SimpleSecurityAgent. diff --git a/src/fr/devinsy/kiss4web/dispatcher/KissDispatcher.java b/src/fr/devinsy/kiss4web/dispatcher/KissDispatcher.java index 5f9d1d3..1957156 100755 --- a/src/fr/devinsy/kiss4web/dispatcher/KissDispatcher.java +++ b/src/fr/devinsy/kiss4web/dispatcher/KissDispatcher.java @@ -21,17 +21,16 @@ package fr.devinsy.kiss4web.dispatcher; import java.io.IOException; import java.util.Date; -import javax.servlet.ServletException; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - import org.slf4j.Logger; import org.slf4j.LoggerFactory; import fr.devinsy.kiss4web.dispatcher.hooks.Hook; import fr.devinsy.kiss4web.dispatcher.hooks.HookRegister; import fr.devinsy.kiss4web.dispatcher.hooks.InitHook; +import jakarta.servlet.ServletException; +import jakarta.servlet.http.HttpServlet; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; /** * The Class KissDispatcher. @@ -161,8 +160,8 @@ public class KissDispatcher extends HttpServlet logger.debug("TIME: {}ms {}", endTime - startTime, request.getPathInfo()); } - /* (non-Javadoc) - * @see javax.servlet.http.HttpServlet#doDelete(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse) + /** + * {@inheritDoc} */ @Override public void doDelete(final HttpServletRequest request, final HttpServletResponse response) throws IOException, ServletException @@ -170,8 +169,8 @@ public class KissDispatcher extends HttpServlet dispatch(request, response); } - /* (non-Javadoc) - * @see javax.servlet.http.HttpServlet#doGet(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse) + /** + * {@inheritDoc} */ @Override public void doGet(final HttpServletRequest request, final HttpServletResponse response) throws IOException, ServletException @@ -179,8 +178,8 @@ public class KissDispatcher extends HttpServlet dispatch(request, response); } - /* (non-Javadoc) - * @see javax.servlet.http.HttpServlet#doPost(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse) + /** + * {@inheritDoc} */ @Override public void doPost(final HttpServletRequest request, final HttpServletResponse response) throws IOException, ServletException @@ -188,8 +187,8 @@ public class KissDispatcher extends HttpServlet dispatch(request, response); } - /* (non-Javadoc) - * @see javax.servlet.http.HttpServlet#doPut(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse) + /** + * {@inheritDoc} */ @Override public void doPut(final HttpServletRequest request, final HttpServletResponse response) throws IOException, ServletException @@ -197,8 +196,8 @@ public class KissDispatcher extends HttpServlet dispatch(request, response); } - /* (non-Javadoc) - * @see javax.servlet.GenericServlet#init() + /** + * {@inheritDoc} */ @Override public void init() throws ServletException diff --git a/src/fr/devinsy/kiss4web/dispatcher/KissDispatcherCache.java b/src/fr/devinsy/kiss4web/dispatcher/KissDispatcherCache.java index 8ab582a..32ee7dd 100644 --- a/src/fr/devinsy/kiss4web/dispatcher/KissDispatcherCache.java +++ b/src/fr/devinsy/kiss4web/dispatcher/KissDispatcherCache.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2006-2021 Christian Pierre MOMON + * Copyright (C) 2006-2023 Christian Pierre MOMON * * This file is part of Kiss4web. * @@ -20,11 +20,11 @@ package fr.devinsy.kiss4web.dispatcher; import java.util.HashMap; -import javax.servlet.http.HttpServlet; - import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import jakarta.servlet.http.HttpServlet; + /** * The Class KissDispatcherCache. */ diff --git a/src/fr/devinsy/kiss4web/dispatcher/KissDispatcherFactory.java b/src/fr/devinsy/kiss4web/dispatcher/KissDispatcherFactory.java index c04531b..1b75068 100644 --- a/src/fr/devinsy/kiss4web/dispatcher/KissDispatcherFactory.java +++ b/src/fr/devinsy/kiss4web/dispatcher/KissDispatcherFactory.java @@ -21,15 +21,15 @@ package fr.devinsy.kiss4web.dispatcher; import java.io.IOException; import java.io.PrintWriter; -import javax.servlet.ServletConfig; -import javax.servlet.ServletException; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import jakarta.servlet.ServletConfig; +import jakarta.servlet.ServletException; +import jakarta.servlet.http.HttpServlet; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; + /** * A factory for creating KissDispatcher objects. * @@ -95,6 +95,14 @@ public class KissDispatcherFactory servlet = KissDispatcherUtils.instanciateServlet("website." + className.replaceAll("Xhtml$", "Page")); } + if (servlet == null) + { + logger.info("Trying with underscore conservative."); + className = translateToClassNameAlternative(urlPath); + logger.info("className=[" + className + "]"); + servlet = KissDispatcherUtils.instanciateServlet("website." + className); + } + if (servlet != null) { servlet.init(servletConfig); @@ -291,4 +299,101 @@ public class KissDispatcherFactory // return result; } + + /** + * Translate to class name. + * + *
+     * "/" => "Index_xhtml"
+     * "/good/" => "good.Index_xhtml"
+     * "/good/morning.xhtml" => "good.MorningXhtml"
+     * "/good/morning_girl.xhtml" => "good.Morning-Girl_xhtml"
+     * "/good/morning-girl.xhtml" => "good.Morning_Girl_xhtml"
+     * 
+ * + * @param urlPath + * the url path + * @return the string + */ + public static String translateToClassNameAlternative(final String urlPath) + { + String result; + + if (urlPath == null) + { + result = null; + } + else + { + if (urlPath.length() == 1) + { + result = "IndexXhtml"; + } + else if (urlPath.endsWith("/")) + { + StringBuffer buffer = new StringBuffer(urlPath.length() + 50); + for (int index = 1; index < urlPath.length(); index++) + { + char letter = urlPath.charAt(index); + + if (letter == '/') + { + buffer.append('.'); + } + else + { + buffer.append(letter); + } + } + buffer.append(".Index_xhtml"); + + result = buffer.toString(); + } + else + { + int lastToken = urlPath.lastIndexOf('/'); + + StringBuffer buffer = new StringBuffer(urlPath.length()); + for (int index = 1; index <= lastToken; index++) + { + char letter = urlPath.charAt(index); + + if (letter == '/') + { + buffer.append('.'); + } + else + { + buffer.append(letter); + } + } + + if (lastToken + 1 < urlPath.length()) + { + buffer.append(Character.toUpperCase(urlPath.charAt(lastToken + 1))); + } + + for (int index = lastToken + 2; index < urlPath.length(); index++) + { + char letter = urlPath.charAt(index); + + if (letter == '.') + { + buffer.append('_'); + } + else + { + buffer.append(letter); + } + } + + result = buffer.toString(); + } + } + + logger.info(urlPath + " -> " + result); + + // + return result; + } } diff --git a/src/fr/devinsy/kiss4web/dispatcher/KissDispatcherUtils.java b/src/fr/devinsy/kiss4web/dispatcher/KissDispatcherUtils.java index 8b3b042..0f65414 100644 --- a/src/fr/devinsy/kiss4web/dispatcher/KissDispatcherUtils.java +++ b/src/fr/devinsy/kiss4web/dispatcher/KissDispatcherUtils.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2006-2021 Christian Pierre MOMON + * Copyright (C) 2006-2023 Christian Pierre MOMON * * This file is part of Kiss4web. * @@ -26,18 +26,17 @@ import java.lang.reflect.InvocationTargetException; import java.util.Date; import java.util.Enumeration; -import javax.servlet.ServletConfig; -import javax.servlet.ServletException; -import javax.servlet.ServletOutputStream; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - import org.slf4j.Logger; import org.slf4j.LoggerFactory; import fr.devinsy.kiss4web.dispatcher.hooks.ShortURLRewriter; import fr.devinsy.strings.StringList; +import jakarta.servlet.ServletConfig; +import jakarta.servlet.ServletException; +import jakarta.servlet.ServletOutputStream; +import jakarta.servlet.http.HttpServlet; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; /** * The Class KissDispatcherUtils. diff --git a/src/fr/devinsy/kiss4web/dispatcher/WebsiteClasspaths.java b/src/fr/devinsy/kiss4web/dispatcher/WebsiteClasspaths.java index 226d0aa..92b3805 100644 --- a/src/fr/devinsy/kiss4web/dispatcher/WebsiteClasspaths.java +++ b/src/fr/devinsy/kiss4web/dispatcher/WebsiteClasspaths.java @@ -20,13 +20,12 @@ package fr.devinsy.kiss4web.dispatcher; import java.util.Iterator; -import javax.servlet.http.HttpServlet; - import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import fr.devinsy.strings.StringList; +import jakarta.servlet.http.HttpServlet; /** * The Class WebsiteClasspaths. @@ -45,8 +44,8 @@ public class WebsiteClasspaths extends StringList super(); } - /* (non-Javadoc) - * @see java.util.ArrayList#add(java.lang.Object) + /** + * {@inheritDoc} */ @Override public boolean add(final String classpath) diff --git a/src/fr/devinsy/kiss4web/dispatcher/hooks/ApplicationInitFailedHook.java b/src/fr/devinsy/kiss4web/dispatcher/hooks/ApplicationInitFailedHook.java index a2f4bde..4a2ec7b 100644 --- a/src/fr/devinsy/kiss4web/dispatcher/hooks/ApplicationInitFailedHook.java +++ b/src/fr/devinsy/kiss4web/dispatcher/hooks/ApplicationInitFailedHook.java @@ -22,16 +22,16 @@ import java.io.IOException; import java.net.URL; import java.nio.charset.StandardCharsets; -import javax.servlet.ServletConfig; -import javax.servlet.ServletContext; -import javax.servlet.ServletException; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - import org.apache.commons.io.IOUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import jakarta.servlet.ServletConfig; +import jakarta.servlet.ServletContext; +import jakarta.servlet.ServletException; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; + /** * The Class InitHook. */ @@ -47,8 +47,8 @@ public class ApplicationInitFailedHook extends HookCore super(); } - /* (non-Javadoc) - * @see fr.devinsy.kiss4web.kernel.dispatcher.hooks.Hook#matches(javax.servlet.ServletContext, javax.servlet.http.HttpServletRequest) + /** + * {@inheritDoc} */ @Override public boolean matches(final ServletContext servletContext, final HttpServletRequest request) @@ -61,8 +61,8 @@ public class ApplicationInitFailedHook extends HookCore return result; } - /* (non-Javadoc) - * @see fr.devinsy.kiss4web.dispatcher.hooks.Hook#process(javax.servlet.ServletConfig, javax.servlet.ServletContext, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse) + /** + * {@inheritDoc} */ @Override public void process(final ServletConfig servletConfig, final ServletContext servletContext, final HttpServletRequest request, diff --git a/src/fr/devinsy/kiss4web/dispatcher/hooks/ApplicationInitHook.java b/src/fr/devinsy/kiss4web/dispatcher/hooks/ApplicationInitHook.java index d186ef8..83cd17c 100644 --- a/src/fr/devinsy/kiss4web/dispatcher/hooks/ApplicationInitHook.java +++ b/src/fr/devinsy/kiss4web/dispatcher/hooks/ApplicationInitHook.java @@ -22,16 +22,16 @@ import java.io.IOException; import java.net.URL; import java.nio.charset.StandardCharsets; -import javax.servlet.ServletConfig; -import javax.servlet.ServletContext; -import javax.servlet.ServletException; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - import org.apache.commons.io.IOUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import jakarta.servlet.ServletConfig; +import jakarta.servlet.ServletContext; +import jakarta.servlet.ServletException; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; + /** * The Class InitHook. */ @@ -47,8 +47,8 @@ public class ApplicationInitHook extends HookCore super(); } - /* (non-Javadoc) - * @see fr.devinsy.kiss4web.kernel.dispatcher.hooks.Hook#matches(javax.servlet.ServletContext, javax.servlet.http.HttpServletRequest) + /** + * {@inheritDoc} */ @Override public boolean matches(final ServletContext servletContext, final HttpServletRequest request) @@ -61,8 +61,8 @@ public class ApplicationInitHook extends HookCore return result; } - /* (non-Javadoc) - * @see fr.devinsy.kiss4web.dispatcher.hooks.Hook#process(javax.servlet.ServletConfig, javax.servlet.ServletContext, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse) + /** + * {@inheritDoc} */ @Override public void process(final ServletConfig servletConfig, final ServletContext servletContext, final HttpServletRequest request, diff --git a/src/fr/devinsy/kiss4web/dispatcher/hooks/BlankHook.java b/src/fr/devinsy/kiss4web/dispatcher/hooks/BlankHook.java index b016bfc..ea15a63 100644 --- a/src/fr/devinsy/kiss4web/dispatcher/hooks/BlankHook.java +++ b/src/fr/devinsy/kiss4web/dispatcher/hooks/BlankHook.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2006-2021 Christian Pierre MOMON + * Copyright (C) 2006-2023 Christian Pierre MOMON * * This file is part of Kiss4web. * @@ -21,14 +21,14 @@ package fr.devinsy.kiss4web.dispatcher.hooks; import java.io.IOException; import java.io.PrintWriter; -import javax.servlet.ServletConfig; -import javax.servlet.ServletContext; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import jakarta.servlet.ServletConfig; +import jakarta.servlet.ServletContext; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; + /** * The Class BlankHook. */ @@ -44,8 +44,8 @@ public class BlankHook extends HookCore super(); } - /* (non-Javadoc) - * @see fr.devinsy.kiss4web.hooks.Hook#matches(javax.servlet.ServletContext, javax.servlet.http.HttpServletRequest) + /** + * {@inheritDoc} */ @Override public boolean matches(final ServletContext servletContext, final HttpServletRequest request) @@ -67,8 +67,8 @@ public class BlankHook extends HookCore return result; } - /* (non-Javadoc) - * @see fr.devinsy.kiss4web.hooks.Hook#process(javax.servlet.ServletConfig, javax.servlet.ServletContext, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse) + /** + * {@inheritDoc} */ @Override public void process(final ServletConfig servletConfig, final ServletContext servletContext, final HttpServletRequest request, diff --git a/src/fr/devinsy/kiss4web/dispatcher/hooks/ErrorHook.java b/src/fr/devinsy/kiss4web/dispatcher/hooks/ErrorHook.java index 962d1c3..78f94b5 100644 --- a/src/fr/devinsy/kiss4web/dispatcher/hooks/ErrorHook.java +++ b/src/fr/devinsy/kiss4web/dispatcher/hooks/ErrorHook.java @@ -23,16 +23,16 @@ import java.io.IOException; import java.net.URL; import java.nio.charset.StandardCharsets; -import javax.servlet.ServletConfig; -import javax.servlet.ServletContext; -import javax.servlet.ServletException; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - import org.apache.commons.io.IOUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import jakarta.servlet.ServletConfig; +import jakarta.servlet.ServletContext; +import jakarta.servlet.ServletException; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; + /** * The Class ErrorHook. */ @@ -48,8 +48,8 @@ public class ErrorHook extends HookCore super(); } - /* (non-Javadoc) - * @see fr.devinsy.kiss4web.kernel.dispatcher.hooks.Hook#matches(javax.servlet.ServletContext, javax.servlet.http.HttpServletRequest) + /** + * {@inheritDoc} */ @Override public boolean matches(final ServletContext servletContext, final HttpServletRequest request) @@ -69,8 +69,8 @@ public class ErrorHook extends HookCore return result; } - /* (non-Javadoc) - * @see fr.devinsy.kiss4web.dispatcher.hooks.Hook#process(javax.servlet.ServletConfig, javax.servlet.ServletContext, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse) + /** + * {@inheritDoc} */ @Override public void process(final ServletConfig servletConfig, final ServletContext servletContext, final HttpServletRequest request, diff --git a/src/fr/devinsy/kiss4web/dispatcher/hooks/FatalHook.java b/src/fr/devinsy/kiss4web/dispatcher/hooks/FatalHook.java index 7b745ee..bc963f4 100644 --- a/src/fr/devinsy/kiss4web/dispatcher/hooks/FatalHook.java +++ b/src/fr/devinsy/kiss4web/dispatcher/hooks/FatalHook.java @@ -23,16 +23,16 @@ import java.io.IOException; import java.net.URL; import java.nio.charset.StandardCharsets; -import javax.servlet.ServletConfig; -import javax.servlet.ServletContext; -import javax.servlet.ServletException; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - import org.apache.commons.io.IOUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import jakarta.servlet.ServletConfig; +import jakarta.servlet.ServletContext; +import jakarta.servlet.ServletException; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; + /** * The Class FatalHook. */ @@ -48,8 +48,8 @@ public class FatalHook extends HookCore super(); } - /* (non-Javadoc) - * @see fr.devinsy.kiss4web.kernel.dispatcher.hooks.Hook#matches(javax.servlet.ServletContext, javax.servlet.http.HttpServletRequest) + /** + * {@inheritDoc} */ @Override public boolean matches(final ServletContext servletContext, final HttpServletRequest request) @@ -69,8 +69,8 @@ public class FatalHook extends HookCore return result; } - /* (non-Javadoc) - * @see fr.devinsy.kiss4web.dispatcher.hooks.Hook#process(javax.servlet.ServletConfig, javax.servlet.ServletContext, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse) + /** + * {@inheritDoc} */ @Override public void process(final ServletConfig servletConfig, final ServletContext servletContext, final HttpServletRequest request, diff --git a/src/fr/devinsy/kiss4web/dispatcher/hooks/FolderHook.java b/src/fr/devinsy/kiss4web/dispatcher/hooks/FolderHook.java index e4872da..5443fae 100644 --- a/src/fr/devinsy/kiss4web/dispatcher/hooks/FolderHook.java +++ b/src/fr/devinsy/kiss4web/dispatcher/hooks/FolderHook.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2006-2021 Christian Pierre MOMON + * Copyright (C) 2006-2023 Christian Pierre MOMON * * This file is part of Kiss4web. * @@ -20,16 +20,15 @@ package fr.devinsy.kiss4web.dispatcher.hooks; import java.io.IOException; -import javax.servlet.ServletConfig; -import javax.servlet.ServletContext; -import javax.servlet.ServletException; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - import org.slf4j.Logger; import org.slf4j.LoggerFactory; import fr.devinsy.kiss4web.dispatcher.KissDispatcherUtils; +import jakarta.servlet.ServletConfig; +import jakarta.servlet.ServletContext; +import jakarta.servlet.ServletException; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; /** * The Class FolderHook. @@ -46,8 +45,8 @@ public class FolderHook extends HookCore super(); } - /* (non-Javadoc) - * @see fr.devinsy.kiss4web.hooks.Hook#matches(javax.servlet.ServletContext, javax.servlet.http.HttpServletRequest) + /** + * {@inheritDoc} */ @Override public boolean matches(final ServletContext servletContext, final HttpServletRequest request) @@ -69,8 +68,8 @@ public class FolderHook extends HookCore return result; } - /* (non-Javadoc) - * @see fr.devinsy.kiss4web.hooks.Hook#process(javax.servlet.ServletConfig, javax.servlet.ServletContext, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse) + /** + * {@inheritDoc} */ @Override public void process(final ServletConfig servletConfig, final ServletContext servletContext, final HttpServletRequest request, diff --git a/src/fr/devinsy/kiss4web/dispatcher/hooks/Hook.java b/src/fr/devinsy/kiss4web/dispatcher/hooks/Hook.java index 88db6fd..07213b1 100644 --- a/src/fr/devinsy/kiss4web/dispatcher/hooks/Hook.java +++ b/src/fr/devinsy/kiss4web/dispatcher/hooks/Hook.java @@ -20,11 +20,11 @@ package fr.devinsy.kiss4web.dispatcher.hooks; import java.io.IOException; -import javax.servlet.ServletConfig; -import javax.servlet.ServletContext; -import javax.servlet.ServletException; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; +import jakarta.servlet.ServletConfig; +import jakarta.servlet.ServletContext; +import jakarta.servlet.ServletException; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; /** * The Interface Hook. diff --git a/src/fr/devinsy/kiss4web/dispatcher/hooks/HookCore.java b/src/fr/devinsy/kiss4web/dispatcher/hooks/HookCore.java index 05febe3..021468e 100644 --- a/src/fr/devinsy/kiss4web/dispatcher/hooks/HookCore.java +++ b/src/fr/devinsy/kiss4web/dispatcher/hooks/HookCore.java @@ -35,8 +35,8 @@ public abstract class HookCore implements Hook this.terminal = true; } - /* (non-Javadoc) - * @see fr.devinsy.kiss4web.hooks.Hook#isTerminal() + /** + * {@inheritDoc} */ @Override public boolean isTerminal() diff --git a/src/fr/devinsy/kiss4web/dispatcher/hooks/HookRegister.java b/src/fr/devinsy/kiss4web/dispatcher/hooks/HookRegister.java index d3ec022..fe75eee 100644 --- a/src/fr/devinsy/kiss4web/dispatcher/hooks/HookRegister.java +++ b/src/fr/devinsy/kiss4web/dispatcher/hooks/HookRegister.java @@ -20,8 +20,8 @@ package fr.devinsy.kiss4web.dispatcher.hooks; import java.util.Iterator; -import javax.servlet.ServletContext; -import javax.servlet.http.HttpServletRequest; +import jakarta.servlet.ServletContext; +import jakarta.servlet.http.HttpServletRequest; /** * The Class HookRegister. diff --git a/src/fr/devinsy/kiss4web/dispatcher/hooks/InitFailedHook.java b/src/fr/devinsy/kiss4web/dispatcher/hooks/InitFailedHook.java index 7ada872..199bf73 100644 --- a/src/fr/devinsy/kiss4web/dispatcher/hooks/InitFailedHook.java +++ b/src/fr/devinsy/kiss4web/dispatcher/hooks/InitFailedHook.java @@ -23,16 +23,16 @@ import java.io.IOException; import java.net.URL; import java.nio.charset.StandardCharsets; -import javax.servlet.ServletConfig; -import javax.servlet.ServletContext; -import javax.servlet.ServletException; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - import org.apache.commons.io.IOUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import jakarta.servlet.ServletConfig; +import jakarta.servlet.ServletContext; +import jakarta.servlet.ServletException; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; + /** * The Class InitFailedHook. */ @@ -48,8 +48,8 @@ public class InitFailedHook extends HookCore super(); } - /* (non-Javadoc) - * @see fr.devinsy.kiss4web.kernel.dispatcher.hooks.Hook#matches(javax.servlet.ServletContext, javax.servlet.http.HttpServletRequest) + /** + * {@inheritDoc} */ @Override public boolean matches(final ServletContext servletContext, final HttpServletRequest request) @@ -69,8 +69,8 @@ public class InitFailedHook extends HookCore return result; } - /* (non-Javadoc) - * @see fr.devinsy.kiss4web.dispatcher.hooks.Hook#process(javax.servlet.ServletConfig, javax.servlet.ServletContext, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse) + /** + * {@inheritDoc} */ @Override public void process(final ServletConfig servletConfig, final ServletContext servletContext, final HttpServletRequest request, diff --git a/src/fr/devinsy/kiss4web/dispatcher/hooks/InitHook.java b/src/fr/devinsy/kiss4web/dispatcher/hooks/InitHook.java index 65cce00..14df916 100644 --- a/src/fr/devinsy/kiss4web/dispatcher/hooks/InitHook.java +++ b/src/fr/devinsy/kiss4web/dispatcher/hooks/InitHook.java @@ -22,16 +22,16 @@ import java.io.IOException; import java.net.URL; import java.nio.charset.StandardCharsets; -import javax.servlet.ServletConfig; -import javax.servlet.ServletContext; -import javax.servlet.ServletException; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - import org.apache.commons.io.IOUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import jakarta.servlet.ServletConfig; +import jakarta.servlet.ServletContext; +import jakarta.servlet.ServletException; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; + /** * The Class InitHook. */ @@ -47,8 +47,8 @@ public class InitHook extends HookCore super(); } - /* (non-Javadoc) - * @see fr.devinsy.kiss4web.kernel.dispatcher.hooks.Hook#matches(javax.servlet.ServletContext, javax.servlet.http.HttpServletRequest) + /** + * {@inheritDoc} */ @Override public boolean matches(final ServletContext servletContext, final HttpServletRequest request) @@ -61,8 +61,8 @@ public class InitHook extends HookCore return result; } - /* (non-Javadoc) - * @see fr.devinsy.kiss4web.dispatcher.hooks.Hook#process(javax.servlet.ServletConfig, javax.servlet.ServletContext, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse) + /** + * {@inheritDoc} */ @Override public void process(final ServletConfig servletConfig, final ServletContext servletContext, final HttpServletRequest request, diff --git a/src/fr/devinsy/kiss4web/dispatcher/hooks/LongURLHook.java b/src/fr/devinsy/kiss4web/dispatcher/hooks/LongURLHook.java index c6927d9..8ea2b4f 100644 --- a/src/fr/devinsy/kiss4web/dispatcher/hooks/LongURLHook.java +++ b/src/fr/devinsy/kiss4web/dispatcher/hooks/LongURLHook.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2006-2021 Christian Pierre MOMON + * Copyright (C) 2006-2023 Christian Pierre MOMON * * This file is part of Kiss4web. * @@ -20,16 +20,15 @@ package fr.devinsy.kiss4web.dispatcher.hooks; import java.io.IOException; -import javax.servlet.ServletConfig; -import javax.servlet.ServletContext; -import javax.servlet.ServletException; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - import org.slf4j.Logger; import org.slf4j.LoggerFactory; import fr.devinsy.kiss4web.dispatcher.KissDispatcherFactory; +import jakarta.servlet.ServletConfig; +import jakarta.servlet.ServletContext; +import jakarta.servlet.ServletException; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; /** * The Class LongURLHook. @@ -46,8 +45,8 @@ public class LongURLHook extends HookCore super(); } - /* (non-Javadoc) - * @see fr.devinsy.kiss4web.hooks.Hook#matches(javax.servlet.ServletContext, javax.servlet.http.HttpServletRequest) + /** + * {@inheritDoc} */ @Override public boolean matches(final ServletContext servletContext, final HttpServletRequest request) @@ -62,8 +61,8 @@ public class LongURLHook extends HookCore return result; } - /* (non-Javadoc) - * @see fr.devinsy.kiss4web.hooks.Hook#process(javax.servlet.ServletConfig, javax.servlet.ServletContext, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse) + /** + * {@inheritDoc} */ @Override public void process(final ServletConfig servletConfig, final ServletContext servletContext, final HttpServletRequest request, diff --git a/src/fr/devinsy/kiss4web/dispatcher/hooks/LongURLRewriter.java b/src/fr/devinsy/kiss4web/dispatcher/hooks/LongURLRewriter.java index 5aebeaf..bbedbcb 100644 --- a/src/fr/devinsy/kiss4web/dispatcher/hooks/LongURLRewriter.java +++ b/src/fr/devinsy/kiss4web/dispatcher/hooks/LongURLRewriter.java @@ -21,12 +21,11 @@ package fr.devinsy.kiss4web.dispatcher.hooks; import java.util.regex.Matcher; import java.util.regex.Pattern; -import javax.servlet.http.HttpServletRequest; - import org.slf4j.Logger; import org.slf4j.LoggerFactory; import fr.devinsy.strings.StringList; +import jakarta.servlet.http.HttpServletRequest; /** * The Class LongURLRewriter. diff --git a/src/fr/devinsy/kiss4web/dispatcher/hooks/MaintenanceHook.java b/src/fr/devinsy/kiss4web/dispatcher/hooks/MaintenanceHook.java index d70e617..04021bf 100644 --- a/src/fr/devinsy/kiss4web/dispatcher/hooks/MaintenanceHook.java +++ b/src/fr/devinsy/kiss4web/dispatcher/hooks/MaintenanceHook.java @@ -23,16 +23,16 @@ import java.io.IOException; import java.net.URL; import java.nio.charset.StandardCharsets; -import javax.servlet.ServletConfig; -import javax.servlet.ServletContext; -import javax.servlet.ServletException; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - import org.apache.commons.io.IOUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import jakarta.servlet.ServletConfig; +import jakarta.servlet.ServletContext; +import jakarta.servlet.ServletException; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; + /** * The Class MaintenanceHook. */ @@ -48,8 +48,8 @@ public class MaintenanceHook extends HookCore super(); } - /* (non-Javadoc) - * @see fr.devinsy.kiss4web.kernel.dispatcher.hooks.Hook#matches(javax.servlet.ServletContext, javax.servlet.http.HttpServletRequest) + /** + * {@inheritDoc} */ @Override public boolean matches(final ServletContext servletContext, final HttpServletRequest request) @@ -69,8 +69,8 @@ public class MaintenanceHook extends HookCore return result; } - /* (non-Javadoc) - * @see fr.devinsy.kiss4web.dispatcher.hooks.Hook#process(javax.servlet.ServletConfig, javax.servlet.ServletContext, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse) + /** + * {@inheritDoc} */ @Override public void process(final ServletConfig servletConfig, final ServletContext servletContext, final HttpServletRequest request, diff --git a/src/fr/devinsy/kiss4web/dispatcher/hooks/RootHook.java b/src/fr/devinsy/kiss4web/dispatcher/hooks/RootHook.java index 2290fc2..d0bab3f 100644 --- a/src/fr/devinsy/kiss4web/dispatcher/hooks/RootHook.java +++ b/src/fr/devinsy/kiss4web/dispatcher/hooks/RootHook.java @@ -20,16 +20,15 @@ package fr.devinsy.kiss4web.dispatcher.hooks; import java.io.IOException; -import javax.servlet.ServletConfig; -import javax.servlet.ServletContext; -import javax.servlet.ServletException; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - import org.slf4j.Logger; import org.slf4j.LoggerFactory; import fr.devinsy.kiss4web.dispatcher.KissDispatcherFactory; +import jakarta.servlet.ServletConfig; +import jakarta.servlet.ServletContext; +import jakarta.servlet.ServletException; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; /** * The Class RootHook. @@ -46,8 +45,8 @@ public class RootHook extends HookCore super(); } - /* (non-Javadoc) - * @see fr.devinsy.kiss4web.hooks.Hook#matches(javax.servlet.ServletContext, javax.servlet.http.HttpServletRequest) + /** + * {@inheritDoc} */ @Override public boolean matches(final ServletContext servletContext, final HttpServletRequest request) @@ -69,8 +68,8 @@ public class RootHook extends HookCore return result; } - /* (non-Javadoc) - * @see fr.devinsy.kiss4web.hooks.Hook#process(javax.servlet.ServletConfig, javax.servlet.ServletContext, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse) + /** + * {@inheritDoc} */ @Override public void process(final ServletConfig servletConfig, final ServletContext servletContext, final HttpServletRequest request, diff --git a/src/fr/devinsy/kiss4web/dispatcher/hooks/ShortURLHook.java b/src/fr/devinsy/kiss4web/dispatcher/hooks/ShortURLHook.java index f6f415f..1967f72 100644 --- a/src/fr/devinsy/kiss4web/dispatcher/hooks/ShortURLHook.java +++ b/src/fr/devinsy/kiss4web/dispatcher/hooks/ShortURLHook.java @@ -20,16 +20,15 @@ package fr.devinsy.kiss4web.dispatcher.hooks; import java.io.IOException; -import javax.servlet.ServletConfig; -import javax.servlet.ServletContext; -import javax.servlet.ServletException; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - import org.slf4j.Logger; import org.slf4j.LoggerFactory; import fr.devinsy.kiss4web.dispatcher.KissDispatcherFactory; +import jakarta.servlet.ServletConfig; +import jakarta.servlet.ServletContext; +import jakarta.servlet.ServletException; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; /** * The Class ShortURLHook. @@ -46,8 +45,8 @@ public class ShortURLHook extends HookCore super(); } - /* (non-Javadoc) - * @see fr.devinsy.kiss4web.hooks.Hook#matches(javax.servlet.ServletContext, javax.servlet.http.HttpServletRequest) + /** + * {@inheritDoc} */ @Override public boolean matches(final ServletContext servletContext, final HttpServletRequest request) @@ -69,8 +68,8 @@ public class ShortURLHook extends HookCore return result; } - /* (non-Javadoc) - * @see fr.devinsy.kiss4web.hooks.Hook#process(javax.servlet.ServletConfig, javax.servlet.ServletContext, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse) + /** + * {@inheritDoc} */ @Override public void process(final ServletConfig servletConfig, final ServletContext servletContext, final HttpServletRequest request, diff --git a/src/fr/devinsy/kiss4web/dispatcher/hooks/ShortURLRewriter.java b/src/fr/devinsy/kiss4web/dispatcher/hooks/ShortURLRewriter.java index 7c8b039..5cde6d5 100644 --- a/src/fr/devinsy/kiss4web/dispatcher/hooks/ShortURLRewriter.java +++ b/src/fr/devinsy/kiss4web/dispatcher/hooks/ShortURLRewriter.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2006-2021 Christian Pierre MOMON + * Copyright (C) 2006-2023 Christian Pierre MOMON * * This file is part of Kiss4web. * @@ -21,12 +21,11 @@ package fr.devinsy.kiss4web.dispatcher.hooks; import java.util.regex.Matcher; import java.util.regex.Pattern; -import javax.servlet.http.HttpServletRequest; - import org.slf4j.Logger; import org.slf4j.LoggerFactory; import fr.devinsy.strings.StringList; +import jakarta.servlet.http.HttpServletRequest; /** * The Class ShortURLRewriter. diff --git a/src/fr/devinsy/kiss4web/dispatcher/hooks/StatisticsHook.java b/src/fr/devinsy/kiss4web/dispatcher/hooks/StatisticsHook.java index df4b8e3..3b6e62e 100644 --- a/src/fr/devinsy/kiss4web/dispatcher/hooks/StatisticsHook.java +++ b/src/fr/devinsy/kiss4web/dispatcher/hooks/StatisticsHook.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2006-2021 Christian Pierre MOMON + * Copyright (C) 2006-2023 Christian Pierre MOMON * * This file is part of Kiss4web. * @@ -20,14 +20,14 @@ package fr.devinsy.kiss4web.dispatcher.hooks; import java.io.IOException; -import javax.servlet.ServletConfig; -import javax.servlet.ServletContext; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import jakarta.servlet.ServletConfig; +import jakarta.servlet.ServletContext; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; + /** * The Class StatisticsHook. */ @@ -45,8 +45,8 @@ public class StatisticsHook extends HookCore setTerminal(false); } - /* (non-Javadoc) - * @see fr.devinsy.kiss4web.hooks.Hook#matches(javax.servlet.ServletContext, javax.servlet.http.HttpServletRequest) + /** + * {@inheritDoc} */ @Override public boolean matches(final ServletContext servletContext, final HttpServletRequest request) @@ -59,8 +59,8 @@ public class StatisticsHook extends HookCore return result; } - /* (non-Javadoc) - * @see fr.devinsy.kiss4web.hooks.Hook#process(javax.servlet.ServletConfig, javax.servlet.ServletContext, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse) + /** + * {@inheritDoc} */ @Override public void process(final ServletConfig servletConfig, final ServletContext servletContext, final HttpServletRequest request, diff --git a/src/fr/devinsy/kiss4web/dispatcher/hooks/WebContentHook.java b/src/fr/devinsy/kiss4web/dispatcher/hooks/WebContentHook.java index d3f5f38..ca1f894 100644 --- a/src/fr/devinsy/kiss4web/dispatcher/hooks/WebContentHook.java +++ b/src/fr/devinsy/kiss4web/dispatcher/hooks/WebContentHook.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2006-2021 Christian Pierre MOMON + * Copyright (C) 2006-2023 Christian Pierre MOMON * * This file is part of Kiss4web. * @@ -21,16 +21,15 @@ package fr.devinsy.kiss4web.dispatcher.hooks; import java.io.File; import java.io.IOException; -import javax.servlet.ServletConfig; -import javax.servlet.ServletContext; -import javax.servlet.ServletException; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - import org.slf4j.Logger; import org.slf4j.LoggerFactory; import fr.devinsy.kiss4web.dispatcher.KissDispatcherUtils; +import jakarta.servlet.ServletConfig; +import jakarta.servlet.ServletContext; +import jakarta.servlet.ServletException; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; /** * The Class WebContentHook. @@ -47,8 +46,8 @@ public class WebContentHook extends HookCore super(); } - /* (non-Javadoc) - * @see fr.devinsy.kiss4web.hooks.Hook#matches(javax.servlet.ServletContext, javax.servlet.http.HttpServletRequest) + /** + * {@inheritDoc} */ @Override public boolean matches(final ServletContext servletContext, final HttpServletRequest request) @@ -69,8 +68,8 @@ public class WebContentHook extends HookCore return result; } - /* (non-Javadoc) - * @see fr.devinsy.kiss4web.hooks.Hook#process(javax.servlet.ServletConfig, javax.servlet.ServletContext, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse) + /** + * {@inheritDoc} */ @Override public void process(final ServletConfig servletConfig, final ServletContext servletContext, final HttpServletRequest request, diff --git a/src/fr/devinsy/kiss4web/dispatcher/hooks/WebInfHook.java b/src/fr/devinsy/kiss4web/dispatcher/hooks/WebInfHook.java index 52a8ef0..fa4ce84 100644 --- a/src/fr/devinsy/kiss4web/dispatcher/hooks/WebInfHook.java +++ b/src/fr/devinsy/kiss4web/dispatcher/hooks/WebInfHook.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2006-2021 Christian Pierre MOMON + * Copyright (C) 2006-2023 Christian Pierre MOMON * * This file is part of Kiss4web. * @@ -21,16 +21,15 @@ package fr.devinsy.kiss4web.dispatcher.hooks; import java.io.File; import java.io.IOException; -import javax.servlet.ServletConfig; -import javax.servlet.ServletContext; -import javax.servlet.ServletException; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - import org.slf4j.Logger; import org.slf4j.LoggerFactory; import fr.devinsy.kiss4web.dispatcher.KissDispatcherUtils; +import jakarta.servlet.ServletConfig; +import jakarta.servlet.ServletContext; +import jakarta.servlet.ServletException; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; /** * The Class WebInfHook. @@ -47,8 +46,8 @@ public class WebInfHook extends HookCore super(); } - /* (non-Javadoc) - * @see fr.devinsy.kiss4web.hooks.Hook#matches(javax.servlet.ServletContext, javax.servlet.http.HttpServletRequest) + /** + * {@inheritDoc} */ @Override public boolean matches(final ServletContext servletContext, final HttpServletRequest request) @@ -69,8 +68,8 @@ public class WebInfHook extends HookCore return result; } - /* (non-Javadoc) - * @see fr.devinsy.kiss4web.hooks.Hook#process(javax.servlet.ServletConfig, javax.servlet.ServletContext, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse) + /** + * {@inheritDoc} */ @Override public void process(final ServletConfig servletConfig, final ServletContext servletContext, final HttpServletRequest request, diff --git a/src/fr/devinsy/kiss4web/dispatcher/hooks/XHTMLHook.java b/src/fr/devinsy/kiss4web/dispatcher/hooks/XHTMLHook.java index 30187ed..fe51001 100644 --- a/src/fr/devinsy/kiss4web/dispatcher/hooks/XHTMLHook.java +++ b/src/fr/devinsy/kiss4web/dispatcher/hooks/XHTMLHook.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2006-2021 Christian Pierre MOMON + * Copyright (C) 2006-2023 Christian Pierre MOMON * * This file is part of Kiss4web. * @@ -20,16 +20,15 @@ package fr.devinsy.kiss4web.dispatcher.hooks; import java.io.IOException; -import javax.servlet.ServletConfig; -import javax.servlet.ServletContext; -import javax.servlet.ServletException; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - import org.slf4j.Logger; import org.slf4j.LoggerFactory; import fr.devinsy.kiss4web.dispatcher.KissDispatcherFactory; +import jakarta.servlet.ServletConfig; +import jakarta.servlet.ServletContext; +import jakarta.servlet.ServletException; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; /** * The Class XHTMLHook. @@ -46,8 +45,8 @@ public class XHTMLHook extends HookCore super(); } - /* (non-Javadoc) - * @see fr.devinsy.kiss4web.hooks.Hook#matches(javax.servlet.ServletContext, javax.servlet.http.HttpServletRequest) + /** + * {@inheritDoc} */ @Override public boolean matches(final ServletContext servletContext, final HttpServletRequest request) @@ -69,8 +68,8 @@ public class XHTMLHook extends HookCore return result; } - /* (non-Javadoc) - * @see fr.devinsy.kiss4web.hooks.Hook#process(javax.servlet.ServletConfig, javax.servlet.ServletContext, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse) + /** + * {@inheritDoc} */ @Override public void process(final ServletConfig servletConfig, final ServletContext servletContext, final HttpServletRequest request, diff --git a/test/FooSandbox.java b/test/FooSandbox.java index 953d3f0..88523bc 100644 --- a/test/FooSandbox.java +++ b/test/FooSandbox.java @@ -1,6 +1,6 @@ /** - * Copyright (C) 2006-2010, 2013-2016 Christian Pierre MOMON + * Copyright (C) 2006-2023 Christian Pierre MOMON * * This file is part of Kiss4web. * @@ -21,6 +21,7 @@ import org.apache.logging.log4j.Level; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.core.config.Configurator; import org.apache.logging.log4j.core.config.DefaultConfiguration; +import org.slf4j.Logger; import fr.devinsy.kiss4web.dispatcher.KissDispatcherUtils; @@ -29,7 +30,7 @@ import fr.devinsy.kiss4web.dispatcher.KissDispatcherUtils; */ public class FooSandbox { - private static org.apache.logging.log4j.Logger logger; + private static Logger logger; static { @@ -38,25 +39,31 @@ public class FooSandbox Configurator.initialize(new DefaultConfiguration()); Configurator.setRootLevel(Level.INFO); - + logger = LogManager.getLogger(FooSandbox.class.getName()); logger.info("Enter"); // logger.info("Set the log file format..."); - // log = - // org.apache.log4j.Category.getInstance(Application.class.getName()); logger.info("... done."); logger.debug("Exit"); - logger = LogManager.getLogger(FooSandbox.class.getName()); } /** + * Check. * + * @param title + * the title + * @param source + * the source + * @param model + * the model + * @return the string */ public static String check(final String title, final StringBuffer source, final String model) { + logger.info("test"); String result; if (source.indexOf(model) == -1) @@ -74,7 +81,10 @@ public class FooSandbox } /** + * The main method. * + * @param args + * the arguments */ public static void main(final String[] args) { @@ -87,7 +97,13 @@ public class FooSandbox } /** - * + * Test caller. + * + * @param pathInfo + * the path info + * @param prefix + * the prefix + * @return the string */ public static String testCaller(final String pathInfo, final String prefix) { diff --git a/test/fr/devinsy/kiss4web/mocks/HttpServletRequestMock.java b/test/fr/devinsy/kiss4web/mocks/HttpServletRequestMock.java index 879d735..bc1dd61 100644 --- a/test/fr/devinsy/kiss4web/mocks/HttpServletRequestMock.java +++ b/test/fr/devinsy/kiss4web/mocks/HttpServletRequestMock.java @@ -1,7 +1,5 @@ -package fr.devinsy.kiss4web.mocks; - /** - * Copyright (C) 2016-2021 Christian Pierre MOMON + * Copyright (C) 2016-2023 Christian Pierre MOMON * * This file is part of Kiss4web. * @@ -18,6 +16,7 @@ package fr.devinsy.kiss4web.mocks; * You should have received a copy of the GNU Lesser General Public License * along with Kiss4web. If not, see */ +package fr.devinsy.kiss4web.mocks; import java.io.BufferedReader; import java.io.IOException; @@ -28,25 +27,25 @@ import java.util.Enumeration; import java.util.Locale; import java.util.Map; -import javax.servlet.AsyncContext; -import javax.servlet.DispatcherType; -import javax.servlet.RequestDispatcher; -import javax.servlet.ServletContext; -import javax.servlet.ServletException; -import javax.servlet.ServletInputStream; -import javax.servlet.ServletRequest; -import javax.servlet.ServletResponse; -import javax.servlet.http.Cookie; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import javax.servlet.http.HttpSession; -import javax.servlet.http.HttpUpgradeHandler; -import javax.servlet.http.Part; - import org.slf4j.Logger; import org.slf4j.LoggerFactory; import fr.devinsy.kiss4web.dispatcher.hooks.ShortURLHook; +import jakarta.servlet.AsyncContext; +import jakarta.servlet.DispatcherType; +import jakarta.servlet.RequestDispatcher; +import jakarta.servlet.ServletConnection; +import jakarta.servlet.ServletContext; +import jakarta.servlet.ServletException; +import jakarta.servlet.ServletInputStream; +import jakarta.servlet.ServletRequest; +import jakarta.servlet.ServletResponse; +import jakarta.servlet.http.Cookie; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; +import jakarta.servlet.http.HttpSession; +import jakarta.servlet.http.HttpUpgradeHandler; +import jakarta.servlet.http.Part; /** * The Class HttpServletRequestMock. @@ -294,6 +293,13 @@ public class HttpServletRequestMock implements HttpServletRequest return null; } + @Override + public String getProtocolRequestId() + { + // TODO Auto-generated method stub + return null; + } + @Override public String getQueryString() { @@ -308,13 +314,6 @@ public class HttpServletRequestMock implements HttpServletRequest return null; } - @Override - public String getRealPath(final String path) - { - // TODO Auto-generated method stub - return null; - } - @Override public String getRemoteAddr() { @@ -357,6 +356,13 @@ public class HttpServletRequestMock implements HttpServletRequest return null; } + @Override + public String getRequestId() + { + // TODO Auto-generated method stub + return null; + } + @Override public String getRequestURI() { @@ -392,6 +398,13 @@ public class HttpServletRequestMock implements HttpServletRequest return 0; } + @Override + public ServletConnection getServletConnection() + { + // TODO Auto-generated method stub + return null; + } + @Override public ServletContext getServletContext() { @@ -448,13 +461,6 @@ public class HttpServletRequestMock implements HttpServletRequest return false; } - @Override - public boolean isRequestedSessionIdFromUrl() - { - // TODO Auto-generated method stub - return false; - } - @Override public boolean isRequestedSessionIdFromURL() {