Migrated to Tomcat 10.1. Improved code, Javadoc, doc, process…

This commit is contained in:
Christian P. MOMON 2023-11-29 16:25:42 +01:00
parent 02a8c54cb6
commit 67a2993cf5
42 changed files with 555 additions and 317 deletions

View file

@ -13,7 +13,6 @@
<classpathentry kind="lib" path="lib/commons-fileupload-1.3.jar" sourcepath="lib/commons-fileupload-1.3-sources.jar"/> <classpathentry kind="lib" path="lib/commons-fileupload-1.3.jar" sourcepath="lib/commons-fileupload-1.3-sources.jar"/>
<classpathentry kind="lib" path="lib/UnitTesting/hamcrest-core-1.3.jar" sourcepath="lib/UnitTesting/hamcrest-core-1.3-sources.jar"/> <classpathentry kind="lib" path="lib/UnitTesting/hamcrest-core-1.3.jar" sourcepath="lib/UnitTesting/hamcrest-core-1.3-sources.jar"/>
<classpathentry kind="lib" path="lib/UnitTesting/junit-4.12.jar" sourcepath="lib/UnitTesting/junit-4.12-sources.jar"/> <classpathentry kind="lib" path="lib/UnitTesting/junit-4.12.jar" sourcepath="lib/UnitTesting/junit-4.12-sources.jar"/>
<classpathentry kind="lib" path="lib/tomcat9-servlet-api-9.0.31.jar" sourcepath="lib/tomcat9-servlet-api-9.0.31-sources.jar"/>
<classpathentry kind="lib" path="lib/commons-io-2.7.jar" sourcepath="lib/commons-io-2.7-sources.jar"/> <classpathentry kind="lib" path="lib/commons-io-2.7.jar" sourcepath="lib/commons-io-2.7-sources.jar"/>
<classpathentry kind="lib" path="lib/Logs/log4j-api-2.17.0.jar" sourcepath="lib/Logs/log4j-api-2.17.0-sources.jar"/> <classpathentry kind="lib" path="lib/Logs/log4j-api-2.17.0.jar" sourcepath="lib/Logs/log4j-api-2.17.0-sources.jar"/>
<classpathentry kind="lib" path="lib/Logs/log4j-core-2.17.0.jar" sourcepath="lib/Logs/log4j-core-2.17.0-sources.jar"/> <classpathentry kind="lib" path="lib/Logs/log4j-core-2.17.0.jar" sourcepath="lib/Logs/log4j-core-2.17.0-sources.jar"/>

116
README.md
View file

@ -13,9 +13,17 @@ Kiss4web builds on:
- KissDispatcher: call the good Java Servlet for each HTTP request, - KissDispatcher: call the good Java Servlet for each HTTP request,
- Xidyn: a template solution to dynamize HTML sources. - Xidyn: a template solution to dynamize HTML sources.
## Author
Lead developer: Christian Pierre MOMON <christian.momon@devinsy.fr>
## License
Kiss4web is released under the GNU LGPL license.
## Developing environment ## 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 ## 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.jar : only compiled class without any library.
- x-core-source.jar : sources. - 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. ## Usages
```
B --> FooAppLauncher -------------------------> FooApp
[ServletContextListener] [Singleton]
|
| setMode(Mode.OPEN)
\ /
A --> Kiss4webLauncher ----setMode(Mode.OPEN)---> Kiss4web <Mode.APP_INIT>
[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` :
```
<listener>
<listener-class>fr.devinsy.kiss4web.Kiss4webLauncher</listener-class>
</listener>
<servlet>
<servlet-name>Application dispatcher</servlet-name>
<servlet-class>fr.devinsy.kiss4web.dispatcher.KissDispatcher</servlet-class>
<init-param>
<param-name>webClassesRootPackage</param-name>
<param-value>website</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>Application dispatcher</servlet-name>
<url-pattern>/*</url-pattern>
</servlet-mapping>
```
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` :
```
<listener>
<listener-class>org.foo.app.FooAppLauncher</listener-class>
</listener>
<servlet>
<servlet-name>Application dispatcher</servlet-name>
<servlet-class>fr.devinsy.kiss4web.dispatcher.KissDispatcher</servlet-class>
<init-param>
<param-name>webClassesRootPackage</param-name>
<param-value>website</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>Application dispatcher</servlet-name>
<url-pattern>/*</url-pattern>
</servlet-mapping>
```

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View file

@ -1,5 +1,5 @@
/** /**
* Copyright (C) 2006-2021 Christian Pierre MOMON * Copyright (C) 2006-2023 Christian Pierre MOMON
* *
* This file is part of Kiss4web. * This file is part of Kiss4web.
* *
@ -20,26 +20,26 @@ package fr.devinsy.kiss4web;
import java.io.UnsupportedEncodingException; 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.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import jakarta.servlet.http.Cookie;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
/** /**
* The Class CookieHelper. * The Class CookieHelper.
*/ */
public class CookieHelper public class CookieHelper
{ {
private static final Logger logger = LoggerFactory.getLogger(CookieHelper.class);
public enum Scope public enum Scope
{ {
HTTP_AND_HTTPS, HTTP_AND_HTTPS,
HTTPS_ONLY HTTPS_ONLY
} }
private static final Logger logger = LoggerFactory.getLogger(CookieHelper.class);
/** /**
* Builds the cookie. * Builds the cookie.
* *

View file

@ -80,11 +80,11 @@ public class EnvironmentInformation
try try
{ {
result = (String) this.environment.lookup("kiss4web.log4j.path"); result = (String) this.environment.lookup("kiss4web.log4j2.path");
} }
catch (NamingException exception) catch (NamingException exception)
{ {
throw new ConfigurationException("Context configuration error on log4j path."); throw new ConfigurationException("Context configuration error on log4j2 path.");
} }
// //

View file

@ -50,8 +50,8 @@ public class Kiss4web
{ {
INIT, INIT,
INIT_FAILED, INIT_FAILED,
APPLICATION_INIT, APP_INIT,
APPLICATION_INIT_FAILED, APP_INIT_FAILED,
OPEN, OPEN,
MAINTENANCE, MAINTENANCE,
FATAL, FATAL,
@ -78,7 +78,7 @@ public class Kiss4web
try try
{ {
// //
this.mode = Mode.INIT; setMode(Mode.INIT);
// //
currentLog = "Kiss4web"; currentLog = "Kiss4web";
@ -96,8 +96,8 @@ public class Kiss4web
// //
// //
setMode(Mode.APPLICATION_INIT); setMode(Mode.APP_INIT);
logInit("set APPLICATION INIT mode", "PASSED"); logInit("set APP INIT mode", "PASSED");
// //
currentLog = "Kiss4web"; currentLog = "Kiss4web";
@ -145,6 +145,12 @@ public class Kiss4web
switch (mode) switch (mode)
{ {
case INIT: case INIT:
{
if (this.mode == null)
{
this.mode = Mode.INIT;
}
}
break; break;
case INIT_FAILED: case INIT_FAILED:
@ -159,7 +165,7 @@ public class Kiss4web
} }
break; break;
case APPLICATION_INIT: case APP_INIT:
{ {
if (this.mode == Mode.INIT) if (this.mode == Mode.INIT)
{ {
@ -171,9 +177,9 @@ public class Kiss4web
} }
break; 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; this.mode = mode;
HookRegister hooks = new HookRegister("Application Init failed"); HookRegister hooks = new HookRegister("Application Init failed");
@ -184,6 +190,8 @@ public class Kiss4web
break; break;
case OPEN: case OPEN:
{
if ((this.mode == Mode.INIT) || (this.mode == Mode.APP_INIT))
{ {
this.mode = mode; this.mode = mode;
@ -199,6 +207,7 @@ public class Kiss4web
KissDispatcher.setHookRegister(hooks); KissDispatcher.setHookRegister(hooks);
} }
}
break; break;
case MAINTENANCE: case MAINTENANCE:

View file

@ -1,28 +1,26 @@
/* /**
* Copyright (C) 2021-2023 Christian Pierre MOMON <christian.momon@devinsy.fr> * Copyright (C) 2013-2023 Christian Pierre MOMON <christian.momon@devinsy.fr>
* *
* 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 * Kiss4web is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as * it under the terms of the GNU Lesser General Public License as published by
* published by the Free Software Foundation, either version 3 of the * the Free Software Foundation, either version 3 of the License, or
* License, or (at your option) any later version. * (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 * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 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 * You should have received a copy of the GNU Lesser General Public License
* along with Juga. If not, see <http://www.gnu.org/licenses/>. * along with Kiss4web. If not, see <http://www.gnu.org/licenses/>
*/ */
package fr.devinsy.kiss4web; package fr.devinsy.kiss4web;
import java.io.File; import java.io.File;
import javax.naming.ConfigurationException; import javax.naming.ConfigurationException;
import javax.servlet.ServletContext;
import javax.servlet.ServletContextEvent;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.apache.logging.log4j.core.config.Configurator; 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.Logger;
import org.slf4j.LoggerFactory; 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); 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 @Override
public void contextInitialized(final ServletContextEvent event) 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) public void launch(final ServletContext context)
{ {
System.out.println("========= KISS4WEB WEBAPP LAUNCHING… ==========");
initLogger(context.getRealPath("/"));
Kiss4web.instance();
System.out.println("========= KISS4WEB WEBAPP LAUNCHED ==========");
} }
} }

View file

@ -20,9 +20,9 @@ package fr.devinsy.kiss4web;
import java.io.IOException; import java.io.IOException;
import javax.servlet.ServletException; import jakarta.servlet.ServletException;
import javax.servlet.http.HttpServletRequest; import jakarta.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import jakarta.servlet.http.HttpServletResponse;
/** /**
* The Class Page. * The Class Page.

View file

@ -18,11 +18,11 @@
*/ */
package fr.devinsy.kiss4web; package fr.devinsy.kiss4web;
import javax.servlet.http.HttpServletResponse;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import jakarta.servlet.http.HttpServletResponse;
/** /**
* The Class Redirector. * The Class Redirector.
*/ */

View file

@ -18,14 +18,13 @@
*/ */
package fr.devinsy.kiss4web; package fr.devinsy.kiss4web;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.commons.codec.digest.DigestUtils; import org.apache.commons.codec.digest.DigestUtils;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import fr.devinsy.strings.StringList; import fr.devinsy.strings.StringList;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
/** /**
* The Class SimpleSecurityAgent. * The Class SimpleSecurityAgent.

View file

@ -21,17 +21,16 @@ package fr.devinsy.kiss4web.dispatcher;
import java.io.IOException; import java.io.IOException;
import java.util.Date; 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.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import fr.devinsy.kiss4web.dispatcher.hooks.Hook; import fr.devinsy.kiss4web.dispatcher.hooks.Hook;
import fr.devinsy.kiss4web.dispatcher.hooks.HookRegister; import fr.devinsy.kiss4web.dispatcher.hooks.HookRegister;
import fr.devinsy.kiss4web.dispatcher.hooks.InitHook; 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. * The Class KissDispatcher.
@ -161,8 +160,8 @@ public class KissDispatcher extends HttpServlet
logger.debug("TIME: {}ms {}", endTime - startTime, request.getPathInfo()); 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 @Override
public void doDelete(final HttpServletRequest request, final HttpServletResponse response) throws IOException, ServletException public void doDelete(final HttpServletRequest request, final HttpServletResponse response) throws IOException, ServletException
@ -170,8 +169,8 @@ public class KissDispatcher extends HttpServlet
dispatch(request, response); dispatch(request, response);
} }
/* (non-Javadoc) /**
* @see javax.servlet.http.HttpServlet#doGet(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse) * {@inheritDoc}
*/ */
@Override @Override
public void doGet(final HttpServletRequest request, final HttpServletResponse response) throws IOException, ServletException public void doGet(final HttpServletRequest request, final HttpServletResponse response) throws IOException, ServletException
@ -179,8 +178,8 @@ public class KissDispatcher extends HttpServlet
dispatch(request, response); dispatch(request, response);
} }
/* (non-Javadoc) /**
* @see javax.servlet.http.HttpServlet#doPost(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse) * {@inheritDoc}
*/ */
@Override @Override
public void doPost(final HttpServletRequest request, final HttpServletResponse response) throws IOException, ServletException public void doPost(final HttpServletRequest request, final HttpServletResponse response) throws IOException, ServletException
@ -188,8 +187,8 @@ public class KissDispatcher extends HttpServlet
dispatch(request, response); dispatch(request, response);
} }
/* (non-Javadoc) /**
* @see javax.servlet.http.HttpServlet#doPut(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse) * {@inheritDoc}
*/ */
@Override @Override
public void doPut(final HttpServletRequest request, final HttpServletResponse response) throws IOException, ServletException public void doPut(final HttpServletRequest request, final HttpServletResponse response) throws IOException, ServletException
@ -197,8 +196,8 @@ public class KissDispatcher extends HttpServlet
dispatch(request, response); dispatch(request, response);
} }
/* (non-Javadoc) /**
* @see javax.servlet.GenericServlet#init() * {@inheritDoc}
*/ */
@Override @Override
public void init() throws ServletException public void init() throws ServletException

View file

@ -1,5 +1,5 @@
/** /**
* Copyright (C) 2006-2021 Christian Pierre MOMON * Copyright (C) 2006-2023 Christian Pierre MOMON
* *
* This file is part of Kiss4web. * This file is part of Kiss4web.
* *
@ -20,11 +20,11 @@ package fr.devinsy.kiss4web.dispatcher;
import java.util.HashMap; import java.util.HashMap;
import javax.servlet.http.HttpServlet;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import jakarta.servlet.http.HttpServlet;
/** /**
* The Class KissDispatcherCache. * The Class KissDispatcherCache.
*/ */

View file

@ -21,15 +21,15 @@ package fr.devinsy.kiss4web.dispatcher;
import java.io.IOException; import java.io.IOException;
import java.io.PrintWriter; 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.Logger;
import org.slf4j.LoggerFactory; 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. * A factory for creating KissDispatcher objects.
* *
@ -95,6 +95,14 @@ public class KissDispatcherFactory
servlet = KissDispatcherUtils.instanciateServlet("website." + className.replaceAll("Xhtml$", "Page")); 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) if (servlet != null)
{ {
servlet.init(servletConfig); servlet.init(servletConfig);
@ -291,4 +299,101 @@ public class KissDispatcherFactory
// //
return result; return result;
} }
/**
* Translate to class name.
*
* <pre>
* "/" => "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"
* </pre>
*
* @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;
}
} }

View file

@ -1,5 +1,5 @@
/** /**
* Copyright (C) 2006-2021 Christian Pierre MOMON * Copyright (C) 2006-2023 Christian Pierre MOMON
* *
* This file is part of Kiss4web. * This file is part of Kiss4web.
* *
@ -26,18 +26,17 @@ import java.lang.reflect.InvocationTargetException;
import java.util.Date; import java.util.Date;
import java.util.Enumeration; 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.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import fr.devinsy.kiss4web.dispatcher.hooks.ShortURLRewriter; import fr.devinsy.kiss4web.dispatcher.hooks.ShortURLRewriter;
import fr.devinsy.strings.StringList; 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. * The Class KissDispatcherUtils.

View file

@ -20,13 +20,12 @@ package fr.devinsy.kiss4web.dispatcher;
import java.util.Iterator; import java.util.Iterator;
import javax.servlet.http.HttpServlet;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import fr.devinsy.strings.StringList; import fr.devinsy.strings.StringList;
import jakarta.servlet.http.HttpServlet;
/** /**
* The Class WebsiteClasspaths. * The Class WebsiteClasspaths.
@ -45,8 +44,8 @@ public class WebsiteClasspaths extends StringList
super(); super();
} }
/* (non-Javadoc) /**
* @see java.util.ArrayList#add(java.lang.Object) * {@inheritDoc}
*/ */
@Override @Override
public boolean add(final String classpath) public boolean add(final String classpath)

View file

@ -22,16 +22,16 @@ import java.io.IOException;
import java.net.URL; import java.net.URL;
import java.nio.charset.StandardCharsets; 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.apache.commons.io.IOUtils;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; 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. * The Class InitHook.
*/ */
@ -47,8 +47,8 @@ public class ApplicationInitFailedHook extends HookCore
super(); super();
} }
/* (non-Javadoc) /**
* @see fr.devinsy.kiss4web.kernel.dispatcher.hooks.Hook#matches(javax.servlet.ServletContext, javax.servlet.http.HttpServletRequest) * {@inheritDoc}
*/ */
@Override @Override
public boolean matches(final ServletContext servletContext, final HttpServletRequest request) public boolean matches(final ServletContext servletContext, final HttpServletRequest request)
@ -61,8 +61,8 @@ public class ApplicationInitFailedHook extends HookCore
return result; 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 @Override
public void process(final ServletConfig servletConfig, final ServletContext servletContext, final HttpServletRequest request, public void process(final ServletConfig servletConfig, final ServletContext servletContext, final HttpServletRequest request,

View file

@ -22,16 +22,16 @@ import java.io.IOException;
import java.net.URL; import java.net.URL;
import java.nio.charset.StandardCharsets; 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.apache.commons.io.IOUtils;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; 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. * The Class InitHook.
*/ */
@ -47,8 +47,8 @@ public class ApplicationInitHook extends HookCore
super(); super();
} }
/* (non-Javadoc) /**
* @see fr.devinsy.kiss4web.kernel.dispatcher.hooks.Hook#matches(javax.servlet.ServletContext, javax.servlet.http.HttpServletRequest) * {@inheritDoc}
*/ */
@Override @Override
public boolean matches(final ServletContext servletContext, final HttpServletRequest request) public boolean matches(final ServletContext servletContext, final HttpServletRequest request)
@ -61,8 +61,8 @@ public class ApplicationInitHook extends HookCore
return result; 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 @Override
public void process(final ServletConfig servletConfig, final ServletContext servletContext, final HttpServletRequest request, public void process(final ServletConfig servletConfig, final ServletContext servletContext, final HttpServletRequest request,

View file

@ -1,5 +1,5 @@
/** /**
* Copyright (C) 2006-2021 Christian Pierre MOMON * Copyright (C) 2006-2023 Christian Pierre MOMON
* *
* This file is part of Kiss4web. * This file is part of Kiss4web.
* *
@ -21,14 +21,14 @@ package fr.devinsy.kiss4web.dispatcher.hooks;
import java.io.IOException; import java.io.IOException;
import java.io.PrintWriter; 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.Logger;
import org.slf4j.LoggerFactory; 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. * The Class BlankHook.
*/ */
@ -44,8 +44,8 @@ public class BlankHook extends HookCore
super(); super();
} }
/* (non-Javadoc) /**
* @see fr.devinsy.kiss4web.hooks.Hook#matches(javax.servlet.ServletContext, javax.servlet.http.HttpServletRequest) * {@inheritDoc}
*/ */
@Override @Override
public boolean matches(final ServletContext servletContext, final HttpServletRequest request) public boolean matches(final ServletContext servletContext, final HttpServletRequest request)
@ -67,8 +67,8 @@ public class BlankHook extends HookCore
return result; 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 @Override
public void process(final ServletConfig servletConfig, final ServletContext servletContext, final HttpServletRequest request, public void process(final ServletConfig servletConfig, final ServletContext servletContext, final HttpServletRequest request,

View file

@ -23,16 +23,16 @@ import java.io.IOException;
import java.net.URL; import java.net.URL;
import java.nio.charset.StandardCharsets; 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.apache.commons.io.IOUtils;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; 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. * The Class ErrorHook.
*/ */
@ -48,8 +48,8 @@ public class ErrorHook extends HookCore
super(); super();
} }
/* (non-Javadoc) /**
* @see fr.devinsy.kiss4web.kernel.dispatcher.hooks.Hook#matches(javax.servlet.ServletContext, javax.servlet.http.HttpServletRequest) * {@inheritDoc}
*/ */
@Override @Override
public boolean matches(final ServletContext servletContext, final HttpServletRequest request) public boolean matches(final ServletContext servletContext, final HttpServletRequest request)
@ -69,8 +69,8 @@ public class ErrorHook extends HookCore
return result; 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 @Override
public void process(final ServletConfig servletConfig, final ServletContext servletContext, final HttpServletRequest request, public void process(final ServletConfig servletConfig, final ServletContext servletContext, final HttpServletRequest request,

View file

@ -23,16 +23,16 @@ import java.io.IOException;
import java.net.URL; import java.net.URL;
import java.nio.charset.StandardCharsets; 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.apache.commons.io.IOUtils;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; 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. * The Class FatalHook.
*/ */
@ -48,8 +48,8 @@ public class FatalHook extends HookCore
super(); super();
} }
/* (non-Javadoc) /**
* @see fr.devinsy.kiss4web.kernel.dispatcher.hooks.Hook#matches(javax.servlet.ServletContext, javax.servlet.http.HttpServletRequest) * {@inheritDoc}
*/ */
@Override @Override
public boolean matches(final ServletContext servletContext, final HttpServletRequest request) public boolean matches(final ServletContext servletContext, final HttpServletRequest request)
@ -69,8 +69,8 @@ public class FatalHook extends HookCore
return result; 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 @Override
public void process(final ServletConfig servletConfig, final ServletContext servletContext, final HttpServletRequest request, public void process(final ServletConfig servletConfig, final ServletContext servletContext, final HttpServletRequest request,

View file

@ -1,5 +1,5 @@
/** /**
* Copyright (C) 2006-2021 Christian Pierre MOMON * Copyright (C) 2006-2023 Christian Pierre MOMON
* *
* This file is part of Kiss4web. * This file is part of Kiss4web.
* *
@ -20,16 +20,15 @@ package fr.devinsy.kiss4web.dispatcher.hooks;
import java.io.IOException; 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.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import fr.devinsy.kiss4web.dispatcher.KissDispatcherUtils; 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. * The Class FolderHook.
@ -46,8 +45,8 @@ public class FolderHook extends HookCore
super(); super();
} }
/* (non-Javadoc) /**
* @see fr.devinsy.kiss4web.hooks.Hook#matches(javax.servlet.ServletContext, javax.servlet.http.HttpServletRequest) * {@inheritDoc}
*/ */
@Override @Override
public boolean matches(final ServletContext servletContext, final HttpServletRequest request) public boolean matches(final ServletContext servletContext, final HttpServletRequest request)
@ -69,8 +68,8 @@ public class FolderHook extends HookCore
return result; 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 @Override
public void process(final ServletConfig servletConfig, final ServletContext servletContext, final HttpServletRequest request, public void process(final ServletConfig servletConfig, final ServletContext servletContext, final HttpServletRequest request,

View file

@ -20,11 +20,11 @@ package fr.devinsy.kiss4web.dispatcher.hooks;
import java.io.IOException; import java.io.IOException;
import javax.servlet.ServletConfig; import jakarta.servlet.ServletConfig;
import javax.servlet.ServletContext; import jakarta.servlet.ServletContext;
import javax.servlet.ServletException; import jakarta.servlet.ServletException;
import javax.servlet.http.HttpServletRequest; import jakarta.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import jakarta.servlet.http.HttpServletResponse;
/** /**
* The Interface Hook. * The Interface Hook.

View file

@ -35,8 +35,8 @@ public abstract class HookCore implements Hook
this.terminal = true; this.terminal = true;
} }
/* (non-Javadoc) /**
* @see fr.devinsy.kiss4web.hooks.Hook#isTerminal() * {@inheritDoc}
*/ */
@Override @Override
public boolean isTerminal() public boolean isTerminal()

View file

@ -20,8 +20,8 @@ package fr.devinsy.kiss4web.dispatcher.hooks;
import java.util.Iterator; import java.util.Iterator;
import javax.servlet.ServletContext; import jakarta.servlet.ServletContext;
import javax.servlet.http.HttpServletRequest; import jakarta.servlet.http.HttpServletRequest;
/** /**
* The Class HookRegister. * The Class HookRegister.

View file

@ -23,16 +23,16 @@ import java.io.IOException;
import java.net.URL; import java.net.URL;
import java.nio.charset.StandardCharsets; 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.apache.commons.io.IOUtils;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; 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. * The Class InitFailedHook.
*/ */
@ -48,8 +48,8 @@ public class InitFailedHook extends HookCore
super(); super();
} }
/* (non-Javadoc) /**
* @see fr.devinsy.kiss4web.kernel.dispatcher.hooks.Hook#matches(javax.servlet.ServletContext, javax.servlet.http.HttpServletRequest) * {@inheritDoc}
*/ */
@Override @Override
public boolean matches(final ServletContext servletContext, final HttpServletRequest request) public boolean matches(final ServletContext servletContext, final HttpServletRequest request)
@ -69,8 +69,8 @@ public class InitFailedHook extends HookCore
return result; 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 @Override
public void process(final ServletConfig servletConfig, final ServletContext servletContext, final HttpServletRequest request, public void process(final ServletConfig servletConfig, final ServletContext servletContext, final HttpServletRequest request,

View file

@ -22,16 +22,16 @@ import java.io.IOException;
import java.net.URL; import java.net.URL;
import java.nio.charset.StandardCharsets; 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.apache.commons.io.IOUtils;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; 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. * The Class InitHook.
*/ */
@ -47,8 +47,8 @@ public class InitHook extends HookCore
super(); super();
} }
/* (non-Javadoc) /**
* @see fr.devinsy.kiss4web.kernel.dispatcher.hooks.Hook#matches(javax.servlet.ServletContext, javax.servlet.http.HttpServletRequest) * {@inheritDoc}
*/ */
@Override @Override
public boolean matches(final ServletContext servletContext, final HttpServletRequest request) public boolean matches(final ServletContext servletContext, final HttpServletRequest request)
@ -61,8 +61,8 @@ public class InitHook extends HookCore
return result; 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 @Override
public void process(final ServletConfig servletConfig, final ServletContext servletContext, final HttpServletRequest request, public void process(final ServletConfig servletConfig, final ServletContext servletContext, final HttpServletRequest request,

View file

@ -1,5 +1,5 @@
/** /**
* Copyright (C) 2006-2021 Christian Pierre MOMON * Copyright (C) 2006-2023 Christian Pierre MOMON
* *
* This file is part of Kiss4web. * This file is part of Kiss4web.
* *
@ -20,16 +20,15 @@ package fr.devinsy.kiss4web.dispatcher.hooks;
import java.io.IOException; 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.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import fr.devinsy.kiss4web.dispatcher.KissDispatcherFactory; 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. * The Class LongURLHook.
@ -46,8 +45,8 @@ public class LongURLHook extends HookCore
super(); super();
} }
/* (non-Javadoc) /**
* @see fr.devinsy.kiss4web.hooks.Hook#matches(javax.servlet.ServletContext, javax.servlet.http.HttpServletRequest) * {@inheritDoc}
*/ */
@Override @Override
public boolean matches(final ServletContext servletContext, final HttpServletRequest request) public boolean matches(final ServletContext servletContext, final HttpServletRequest request)
@ -62,8 +61,8 @@ public class LongURLHook extends HookCore
return result; 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 @Override
public void process(final ServletConfig servletConfig, final ServletContext servletContext, final HttpServletRequest request, public void process(final ServletConfig servletConfig, final ServletContext servletContext, final HttpServletRequest request,

View file

@ -21,12 +21,11 @@ package fr.devinsy.kiss4web.dispatcher.hooks;
import java.util.regex.Matcher; import java.util.regex.Matcher;
import java.util.regex.Pattern; import java.util.regex.Pattern;
import javax.servlet.http.HttpServletRequest;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import fr.devinsy.strings.StringList; import fr.devinsy.strings.StringList;
import jakarta.servlet.http.HttpServletRequest;
/** /**
* The Class LongURLRewriter. * The Class LongURLRewriter.

View file

@ -23,16 +23,16 @@ import java.io.IOException;
import java.net.URL; import java.net.URL;
import java.nio.charset.StandardCharsets; 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.apache.commons.io.IOUtils;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; 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. * The Class MaintenanceHook.
*/ */
@ -48,8 +48,8 @@ public class MaintenanceHook extends HookCore
super(); super();
} }
/* (non-Javadoc) /**
* @see fr.devinsy.kiss4web.kernel.dispatcher.hooks.Hook#matches(javax.servlet.ServletContext, javax.servlet.http.HttpServletRequest) * {@inheritDoc}
*/ */
@Override @Override
public boolean matches(final ServletContext servletContext, final HttpServletRequest request) public boolean matches(final ServletContext servletContext, final HttpServletRequest request)
@ -69,8 +69,8 @@ public class MaintenanceHook extends HookCore
return result; 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 @Override
public void process(final ServletConfig servletConfig, final ServletContext servletContext, final HttpServletRequest request, public void process(final ServletConfig servletConfig, final ServletContext servletContext, final HttpServletRequest request,

View file

@ -20,16 +20,15 @@ package fr.devinsy.kiss4web.dispatcher.hooks;
import java.io.IOException; 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.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import fr.devinsy.kiss4web.dispatcher.KissDispatcherFactory; 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. * The Class RootHook.
@ -46,8 +45,8 @@ public class RootHook extends HookCore
super(); super();
} }
/* (non-Javadoc) /**
* @see fr.devinsy.kiss4web.hooks.Hook#matches(javax.servlet.ServletContext, javax.servlet.http.HttpServletRequest) * {@inheritDoc}
*/ */
@Override @Override
public boolean matches(final ServletContext servletContext, final HttpServletRequest request) public boolean matches(final ServletContext servletContext, final HttpServletRequest request)
@ -69,8 +68,8 @@ public class RootHook extends HookCore
return result; 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 @Override
public void process(final ServletConfig servletConfig, final ServletContext servletContext, final HttpServletRequest request, public void process(final ServletConfig servletConfig, final ServletContext servletContext, final HttpServletRequest request,

View file

@ -20,16 +20,15 @@ package fr.devinsy.kiss4web.dispatcher.hooks;
import java.io.IOException; 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.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import fr.devinsy.kiss4web.dispatcher.KissDispatcherFactory; 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. * The Class ShortURLHook.
@ -46,8 +45,8 @@ public class ShortURLHook extends HookCore
super(); super();
} }
/* (non-Javadoc) /**
* @see fr.devinsy.kiss4web.hooks.Hook#matches(javax.servlet.ServletContext, javax.servlet.http.HttpServletRequest) * {@inheritDoc}
*/ */
@Override @Override
public boolean matches(final ServletContext servletContext, final HttpServletRequest request) public boolean matches(final ServletContext servletContext, final HttpServletRequest request)
@ -69,8 +68,8 @@ public class ShortURLHook extends HookCore
return result; 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 @Override
public void process(final ServletConfig servletConfig, final ServletContext servletContext, final HttpServletRequest request, public void process(final ServletConfig servletConfig, final ServletContext servletContext, final HttpServletRequest request,

View file

@ -1,5 +1,5 @@
/** /**
* Copyright (C) 2006-2021 Christian Pierre MOMON * Copyright (C) 2006-2023 Christian Pierre MOMON
* *
* This file is part of Kiss4web. * 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.Matcher;
import java.util.regex.Pattern; import java.util.regex.Pattern;
import javax.servlet.http.HttpServletRequest;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import fr.devinsy.strings.StringList; import fr.devinsy.strings.StringList;
import jakarta.servlet.http.HttpServletRequest;
/** /**
* The Class ShortURLRewriter. * The Class ShortURLRewriter.

View file

@ -1,5 +1,5 @@
/** /**
* Copyright (C) 2006-2021 Christian Pierre MOMON * Copyright (C) 2006-2023 Christian Pierre MOMON
* *
* This file is part of Kiss4web. * This file is part of Kiss4web.
* *
@ -20,14 +20,14 @@ package fr.devinsy.kiss4web.dispatcher.hooks;
import java.io.IOException; 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.Logger;
import org.slf4j.LoggerFactory; 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. * The Class StatisticsHook.
*/ */
@ -45,8 +45,8 @@ public class StatisticsHook extends HookCore
setTerminal(false); setTerminal(false);
} }
/* (non-Javadoc) /**
* @see fr.devinsy.kiss4web.hooks.Hook#matches(javax.servlet.ServletContext, javax.servlet.http.HttpServletRequest) * {@inheritDoc}
*/ */
@Override @Override
public boolean matches(final ServletContext servletContext, final HttpServletRequest request) public boolean matches(final ServletContext servletContext, final HttpServletRequest request)
@ -59,8 +59,8 @@ public class StatisticsHook extends HookCore
return result; 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 @Override
public void process(final ServletConfig servletConfig, final ServletContext servletContext, final HttpServletRequest request, public void process(final ServletConfig servletConfig, final ServletContext servletContext, final HttpServletRequest request,

View file

@ -1,5 +1,5 @@
/** /**
* Copyright (C) 2006-2021 Christian Pierre MOMON * Copyright (C) 2006-2023 Christian Pierre MOMON
* *
* This file is part of Kiss4web. * This file is part of Kiss4web.
* *
@ -21,16 +21,15 @@ package fr.devinsy.kiss4web.dispatcher.hooks;
import java.io.File; import java.io.File;
import java.io.IOException; 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.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import fr.devinsy.kiss4web.dispatcher.KissDispatcherUtils; 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. * The Class WebContentHook.
@ -47,8 +46,8 @@ public class WebContentHook extends HookCore
super(); super();
} }
/* (non-Javadoc) /**
* @see fr.devinsy.kiss4web.hooks.Hook#matches(javax.servlet.ServletContext, javax.servlet.http.HttpServletRequest) * {@inheritDoc}
*/ */
@Override @Override
public boolean matches(final ServletContext servletContext, final HttpServletRequest request) public boolean matches(final ServletContext servletContext, final HttpServletRequest request)
@ -69,8 +68,8 @@ public class WebContentHook extends HookCore
return result; 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 @Override
public void process(final ServletConfig servletConfig, final ServletContext servletContext, final HttpServletRequest request, public void process(final ServletConfig servletConfig, final ServletContext servletContext, final HttpServletRequest request,

View file

@ -1,5 +1,5 @@
/** /**
* Copyright (C) 2006-2021 Christian Pierre MOMON * Copyright (C) 2006-2023 Christian Pierre MOMON
* *
* This file is part of Kiss4web. * This file is part of Kiss4web.
* *
@ -21,16 +21,15 @@ package fr.devinsy.kiss4web.dispatcher.hooks;
import java.io.File; import java.io.File;
import java.io.IOException; 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.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import fr.devinsy.kiss4web.dispatcher.KissDispatcherUtils; 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. * The Class WebInfHook.
@ -47,8 +46,8 @@ public class WebInfHook extends HookCore
super(); super();
} }
/* (non-Javadoc) /**
* @see fr.devinsy.kiss4web.hooks.Hook#matches(javax.servlet.ServletContext, javax.servlet.http.HttpServletRequest) * {@inheritDoc}
*/ */
@Override @Override
public boolean matches(final ServletContext servletContext, final HttpServletRequest request) public boolean matches(final ServletContext servletContext, final HttpServletRequest request)
@ -69,8 +68,8 @@ public class WebInfHook extends HookCore
return result; 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 @Override
public void process(final ServletConfig servletConfig, final ServletContext servletContext, final HttpServletRequest request, public void process(final ServletConfig servletConfig, final ServletContext servletContext, final HttpServletRequest request,

View file

@ -1,5 +1,5 @@
/** /**
* Copyright (C) 2006-2021 Christian Pierre MOMON * Copyright (C) 2006-2023 Christian Pierre MOMON
* *
* This file is part of Kiss4web. * This file is part of Kiss4web.
* *
@ -20,16 +20,15 @@ package fr.devinsy.kiss4web.dispatcher.hooks;
import java.io.IOException; 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.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import fr.devinsy.kiss4web.dispatcher.KissDispatcherFactory; 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. * The Class XHTMLHook.
@ -46,8 +45,8 @@ public class XHTMLHook extends HookCore
super(); super();
} }
/* (non-Javadoc) /**
* @see fr.devinsy.kiss4web.hooks.Hook#matches(javax.servlet.ServletContext, javax.servlet.http.HttpServletRequest) * {@inheritDoc}
*/ */
@Override @Override
public boolean matches(final ServletContext servletContext, final HttpServletRequest request) public boolean matches(final ServletContext servletContext, final HttpServletRequest request)
@ -69,8 +68,8 @@ public class XHTMLHook extends HookCore
return result; 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 @Override
public void process(final ServletConfig servletConfig, final ServletContext servletContext, final HttpServletRequest request, public void process(final ServletConfig servletConfig, final ServletContext servletContext, final HttpServletRequest request,

View file

@ -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. * 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.LogManager;
import org.apache.logging.log4j.core.config.Configurator; import org.apache.logging.log4j.core.config.Configurator;
import org.apache.logging.log4j.core.config.DefaultConfiguration; import org.apache.logging.log4j.core.config.DefaultConfiguration;
import org.slf4j.Logger;
import fr.devinsy.kiss4web.dispatcher.KissDispatcherUtils; import fr.devinsy.kiss4web.dispatcher.KissDispatcherUtils;
@ -29,7 +30,7 @@ import fr.devinsy.kiss4web.dispatcher.KissDispatcherUtils;
*/ */
public class FooSandbox public class FooSandbox
{ {
private static org.apache.logging.log4j.Logger logger; private static Logger logger;
static static
{ {
@ -38,25 +39,31 @@ public class FooSandbox
Configurator.initialize(new DefaultConfiguration()); Configurator.initialize(new DefaultConfiguration());
Configurator.setRootLevel(Level.INFO); Configurator.setRootLevel(Level.INFO);
logger = LogManager.getLogger(FooSandbox.class.getName());
logger.info("Enter"); logger.info("Enter");
// //
logger.info("Set the log file format..."); logger.info("Set the log file format...");
// log =
// org.apache.log4j.Category.getInstance(Application.class.getName());
logger.info("... done."); logger.info("... done.");
logger.debug("Exit"); 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) public static String check(final String title, final StringBuffer source, final String model)
{ {
logger.info("test");
String result; String result;
if (source.indexOf(model) == -1) 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) 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) public static String testCaller(final String pathInfo, final String prefix)
{ {

View file

@ -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. * 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 * You should have received a copy of the GNU Lesser General Public License
* along with Kiss4web. If not, see <http://www.gnu.org/licenses/> * along with Kiss4web. If not, see <http://www.gnu.org/licenses/>
*/ */
package fr.devinsy.kiss4web.mocks;
import java.io.BufferedReader; import java.io.BufferedReader;
import java.io.IOException; import java.io.IOException;
@ -28,25 +27,25 @@ import java.util.Enumeration;
import java.util.Locale; import java.util.Locale;
import java.util.Map; 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.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import fr.devinsy.kiss4web.dispatcher.hooks.ShortURLHook; 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. * The Class HttpServletRequestMock.
@ -294,6 +293,13 @@ public class HttpServletRequestMock implements HttpServletRequest
return null; return null;
} }
@Override
public String getProtocolRequestId()
{
// TODO Auto-generated method stub
return null;
}
@Override @Override
public String getQueryString() public String getQueryString()
{ {
@ -308,13 +314,6 @@ public class HttpServletRequestMock implements HttpServletRequest
return null; return null;
} }
@Override
public String getRealPath(final String path)
{
// TODO Auto-generated method stub
return null;
}
@Override @Override
public String getRemoteAddr() public String getRemoteAddr()
{ {
@ -357,6 +356,13 @@ public class HttpServletRequestMock implements HttpServletRequest
return null; return null;
} }
@Override
public String getRequestId()
{
// TODO Auto-generated method stub
return null;
}
@Override @Override
public String getRequestURI() public String getRequestURI()
{ {
@ -392,6 +398,13 @@ public class HttpServletRequestMock implements HttpServletRequest
return 0; return 0;
} }
@Override
public ServletConnection getServletConnection()
{
// TODO Auto-generated method stub
return null;
}
@Override @Override
public ServletContext getServletContext() public ServletContext getServletContext()
{ {
@ -448,13 +461,6 @@ public class HttpServletRequestMock implements HttpServletRequest
return false; return false;
} }
@Override
public boolean isRequestedSessionIdFromUrl()
{
// TODO Auto-generated method stub
return false;
}
@Override @Override
public boolean isRequestedSessionIdFromURL() public boolean isRequestedSessionIdFromURL()
{ {