Migrated to Tomcat 10.1. Improved code, Javadoc, doc, process…
This commit is contained in:
parent
02a8c54cb6
commit
67a2993cf5
42 changed files with 555 additions and 317 deletions
|
@ -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/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/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/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"/>
|
||||
|
|
116
README.md
116
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 <christian.momon@devinsy.fr>
|
||||
|
||||
## 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.
|
||||
## 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.
BIN
lib/tomcat10-servlet-api-10.1.16-sources.zip
Normal file
BIN
lib/tomcat10-servlet-api-10.1.16-sources.zip
Normal file
Binary file not shown.
BIN
lib/tomcat10-servlet-api-10.1.16.jar
Normal file
BIN
lib/tomcat10-servlet-api-10.1.16.jar
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -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.
|
||||
*
|
||||
|
|
|
@ -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.");
|
||||
}
|
||||
|
||||
//
|
||||
|
|
|
@ -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");
|
||||
|
@ -184,6 +190,8 @@ public class Kiss4web
|
|||
break;
|
||||
|
||||
case OPEN:
|
||||
{
|
||||
if ((this.mode == Mode.INIT) || (this.mode == Mode.APP_INIT))
|
||||
{
|
||||
this.mode = mode;
|
||||
|
||||
|
@ -199,6 +207,7 @@ public class Kiss4web
|
|||
|
||||
KissDispatcher.setHookRegister(hooks);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case MAINTENANCE:
|
||||
|
|
|
@ -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
|
||||
* 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 <http://www.gnu.org/licenses/>.
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with Kiss4web. If not, see <http://www.gnu.org/licenses/>
|
||||
*/
|
||||
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 ==========");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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.
|
||||
*/
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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.
|
||||
*/
|
||||
|
|
|
@ -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.
|
||||
*
|
||||
* <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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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()
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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)
|
||||
{
|
||||
|
|
|
@ -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 <http://www.gnu.org/licenses/>
|
||||
*/
|
||||
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()
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue