hooks()
+ public String getName()
{
- return this.hooks;
+ return this.name;
+ }
+
+ /**
+ * Checks if is empty.
+ *
+ * @return true, if is empty
+ */
+ public boolean isEmpty()
+ {
+ boolean result;
+
+ result = this.hooks.isEmpty();
+
+ //
+ return result;
}
/**
@@ -97,8 +117,20 @@ public class HookRegister
* @param hook
* the hook
*/
- public void register(final Hook hook)
+ public HookRegister register(final Hook hook)
{
+ HookRegister result;
+
this.hooks.add(hook);
+
+ result = this;
+
+ //
+ return result;
+ }
+
+ public void registerAll(final HookRegister register)
+ {
+ this.hooks.addAll(register.getHooks());
}
}
diff --git a/src/fr/devinsy/kiss4web/dispatcher/hooks/LongURLHook.java b/src/fr/devinsy/kiss4web/dispatcher/hooks/LongURLHook.java
index bdab709..c6927d9 100644
--- a/src/fr/devinsy/kiss4web/dispatcher/hooks/LongURLHook.java
+++ b/src/fr/devinsy/kiss4web/dispatcher/hooks/LongURLHook.java
@@ -29,7 +29,7 @@ import javax.servlet.http.HttpServletResponse;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import fr.devinsy.kiss4web.dispatcher.KissDispatcherUtils;
+import fr.devinsy.kiss4web.dispatcher.KissDispatcherFactory;
/**
* The Class LongURLHook.
@@ -75,6 +75,6 @@ public class LongURLHook extends HookCore
String rewritedURLPath = LongURLRewriter.unrewrite(urlPath);
- KissDispatcherUtils.dispatchToServlet(servletConfig, request, response, rewritedURLPath);
+ KissDispatcherFactory.instance().dispatchPathToServlet(servletConfig, request, response, rewritedURLPath);
}
}
diff --git a/src/fr/devinsy/kiss4web/dispatcher/hooks/LongURLRewriter.java b/src/fr/devinsy/kiss4web/dispatcher/hooks/LongURLRewriter.java
index 200f3ee..10d45ae 100644
--- a/src/fr/devinsy/kiss4web/dispatcher/hooks/LongURLRewriter.java
+++ b/src/fr/devinsy/kiss4web/dispatcher/hooks/LongURLRewriter.java
@@ -26,7 +26,7 @@ import javax.servlet.http.HttpServletRequest;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import fr.devinsy.util.strings.StringList;
+import fr.devinsy.strings.StringList;
/**
* The Class LongURLRewriter.
diff --git a/src/fr/devinsy/kiss4web/dispatcher/hooks/RootHook.java b/src/fr/devinsy/kiss4web/dispatcher/hooks/RootHook.java
index c5e0bd6..2290fc2 100644
--- a/src/fr/devinsy/kiss4web/dispatcher/hooks/RootHook.java
+++ b/src/fr/devinsy/kiss4web/dispatcher/hooks/RootHook.java
@@ -29,7 +29,7 @@ import javax.servlet.http.HttpServletResponse;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import fr.devinsy.kiss4web.dispatcher.KissDispatcherUtils;
+import fr.devinsy.kiss4web.dispatcher.KissDispatcherFactory;
/**
* The Class RootHook.
@@ -78,8 +78,8 @@ public class RootHook extends HookCore
{
logger.debug("Doing catch.");
- String className = "index.xhtml";
+ String classPath = "index.xhtml";
- KissDispatcherUtils.dispatchToServlet(servletConfig, request, response, className);
+ KissDispatcherFactory.instance().dispatchPathToServlet(servletConfig, request, response, classPath);
}
}
diff --git a/src/fr/devinsy/kiss4web/dispatcher/hooks/ShortURLHook.java b/src/fr/devinsy/kiss4web/dispatcher/hooks/ShortURLHook.java
index e948857..0977fa6 100644
--- a/src/fr/devinsy/kiss4web/dispatcher/hooks/ShortURLHook.java
+++ b/src/fr/devinsy/kiss4web/dispatcher/hooks/ShortURLHook.java
@@ -29,7 +29,7 @@ import javax.servlet.http.HttpServletResponse;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import fr.devinsy.kiss4web.dispatcher.KissDispatcherUtils;
+import fr.devinsy.kiss4web.dispatcher.KissDispatcherFactory;
/**
* The Class ShortURLHook.
@@ -72,9 +72,12 @@ public class ShortURLHook extends HookCore
logger.debug("Doing catch.");
String urlPath = request.getPathInfo();
-
String rewritedURLPath = ShortURLRewriter.unrewrite(urlPath);
- KissDispatcherUtils.dispatchToServlet(servletConfig, request, response, rewritedURLPath);
+ logger.info("rewritedURLPath={}", rewritedURLPath);
+
+ KissDispatcherFactory.instance().dispatchPathToServlet(servletConfig, request, response, rewritedURLPath);
+ // KissDispatcherFactory.instance().dispatchPathToServlet(servletConfig,
+ // request, response, urlPath, rewritedURLPath);
}
}
diff --git a/src/fr/devinsy/kiss4web/dispatcher/hooks/ShortURLRewriter.java b/src/fr/devinsy/kiss4web/dispatcher/hooks/ShortURLRewriter.java
index fef1dbc..7c8b039 100644
--- a/src/fr/devinsy/kiss4web/dispatcher/hooks/ShortURLRewriter.java
+++ b/src/fr/devinsy/kiss4web/dispatcher/hooks/ShortURLRewriter.java
@@ -26,7 +26,7 @@ import javax.servlet.http.HttpServletRequest;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import fr.devinsy.util.strings.StringList;
+import fr.devinsy.strings.StringList;
/**
* The Class ShortURLRewriter.
@@ -92,7 +92,7 @@ public class ShortURLRewriter
*
*
* "/good/article.xhtm?id=123&class=today&title=story's about me"
- * => rewriteShorturl("/good/article", "xhtml", "123", "Story's aboute me");
+ * => rewriteShorturl("/good/article", "xhtml", "123", "Story's about me");
* => "/good/article-123-today-story-s-about-me.xhtml"
*
*
diff --git a/src/fr/devinsy/kiss4web/dispatcher/hooks/WebContentHook.java b/src/fr/devinsy/kiss4web/dispatcher/hooks/WebContentHook.java
index 9172797..d3f5f38 100644
--- a/src/fr/devinsy/kiss4web/dispatcher/hooks/WebContentHook.java
+++ b/src/fr/devinsy/kiss4web/dispatcher/hooks/WebContentHook.java
@@ -55,6 +55,7 @@ public class WebContentHook extends HookCore
{
boolean result;
+ logger.info("Check for {}", servletContext.getRealPath("/") + request.getPathInfo());
if (new File(servletContext.getRealPath("/") + request.getPathInfo()).exists())
{
result = true;
diff --git a/src/fr/devinsy/kiss4web/dispatcher/hooks/WebInfHook.java b/src/fr/devinsy/kiss4web/dispatcher/hooks/WebInfHook.java
index 6265a9d..52a8ef0 100644
--- a/src/fr/devinsy/kiss4web/dispatcher/hooks/WebInfHook.java
+++ b/src/fr/devinsy/kiss4web/dispatcher/hooks/WebInfHook.java
@@ -55,6 +55,7 @@ public class WebInfHook extends HookCore
{
boolean result;
+ logger.info("Check for {}", servletContext.getRealPath("/") + "WEB-INF/classes/website" + request.getPathInfo());
if (new File(servletContext.getRealPath("/") + "WEB-INF/classes/website" + request.getPathInfo()).exists())
{
result = true;
diff --git a/src/fr/devinsy/kiss4web/dispatcher/hooks/XHTMLHook.java b/src/fr/devinsy/kiss4web/dispatcher/hooks/XHTMLHook.java
index 83b27f6..30187ed 100644
--- a/src/fr/devinsy/kiss4web/dispatcher/hooks/XHTMLHook.java
+++ b/src/fr/devinsy/kiss4web/dispatcher/hooks/XHTMLHook.java
@@ -29,7 +29,7 @@ import javax.servlet.http.HttpServletResponse;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import fr.devinsy.kiss4web.dispatcher.KissDispatcherUtils;
+import fr.devinsy.kiss4web.dispatcher.KissDispatcherFactory;
/**
* The Class XHTMLHook.
@@ -80,6 +80,6 @@ public class XHTMLHook extends HookCore
String urlPath = request.getPathInfo();
- KissDispatcherUtils.dispatchToServlet(servletConfig, request, response, urlPath);
+ KissDispatcherFactory.instance().dispatchPathToServlet(servletConfig, request, response, urlPath);
}
}