diff --git a/example_application/adapters/config/ApplicationRoutes.java b/example_application/adapters/config/ApplicationRoutes.java index 0402cfd..9d60a9e 100644 --- a/example_application/adapters/config/ApplicationRoutes.java +++ b/example_application/adapters/config/ApplicationRoutes.java @@ -1,7 +1,7 @@ package config; import controllers.PeopleController; -import hex.action.RouteManager; +import hex.action.routing.RouteManager; /** * Created by jason on 14-11-16. diff --git a/example_application/views/layouts/application.html.jsp b/example_application/views/layouts/application.html.jsp index 3d4cf84..7e885d9 100644 --- a/example_application/views/layouts/application.html.jsp +++ b/example_application/views/layouts/application.html.jsp @@ -9,10 +9,12 @@
+ * The initialize method is called to initialize an uninitialized PageContext + * so that it may be used by a JSP Implementation class to service an + * incoming request and response within it's _jspService() method. + *
+ *
+ * This method is typically called from JspFactory.getPageContext() in + * order to initialize state. + *
+ *
+ * This method is required to create an initial JspWriter, and associate + * the "out" name in page scope with this newly created object. + *
+ *
+ * This method should not be used by page or tag library authors. + * + * @param servlet The Servlet that is associated with this PageContext + * @param request The currently pending request for this Servlet + * @param response The currently pending response for this Servlet + * @param errorPageURL The value of the errorpage attribute from the page + * directive or null + * @param needsSession The value of the session attribute from the + * page directive + * @param bufferSize The value of the buffer attribute from the page + * directive + * @param autoFlush The value of the autoflush attribute from the page + * directive + * @throws java.io.IOException during creation of JspWriter + * @throws IllegalStateException if out not correctly initialized + * @throws IllegalArgumentException If one of the given parameters + * is invalid + */ + @Override + public void initialize(Servlet servlet, ServletRequest request, ServletResponse response, String errorPageURL, boolean needsSession, int bufferSize, boolean autoFlush) throws IOException, IllegalStateException, IllegalArgumentException { + + } + + /** + *
+ * This method shall "reset" the internal state of a PageContext, releasing + * all internal references, and preparing the PageContext for potential + * reuse by a later invocation of initialize(). This method is typically + * called from JspFactory.releasePageContext(). + *
+ *
+ * Subclasses shall envelope this method. + *
+ *
+ * This method should not be used by page or tag library authors. + */ + @Override + public void release() { + + } + + /** + * The current value of the session object (an HttpSession). + * + * @return the HttpSession for this PageContext or null + */ + @Override + public HttpSession getSession() { + return request.getSession(); + } + + /** + * The current value of the page object (In a Servlet environment, + * this is an instance of javax.servlet.Servlet). + * + * @return the Page implementation class instance associated + * with this PageContext + */ + @Override + public Object getPage() { + return null; + } + + /** + * The current value of the request object (a ServletRequest). + * + * @return The ServletRequest for this PageContext + */ + @Override + public ServletRequest getRequest() { + return request; + } + + /** + * The current value of the response object (a ServletResponse). + * + * @return the ServletResponse for this PageContext + */ + @Override + public ServletResponse getResponse() { + return null; + } + + /** + * The current value of the exception object (an Exception). + * + * @return any exception passed to this as an errorpage + */ + @Override + public Exception getException() { + return null; + } + + /** + * The ServletConfig instance. + * + * @return the ServletConfig for this PageContext + */ + @Override + public ServletConfig getServletConfig() { + return null; + } + + /** + * The ServletContext instance. + * + * @return the ServletContext for this PageContext + */ + @Override + public ServletContext getServletContext() { + return null; + } + + /** + *
+ * This method is used to re-direct, or "forward" the current + * ServletRequest and ServletResponse to another active component in + * the application. + *
+ *
+ * If the relativeUrlPath begins with a "/" then the URL specified
+ * is calculated relative to the DOCROOT of the ServletContext
+ * for this JSP. If the path does not begin with a "/" then the URL
+ * specified is calculated relative to the URL of the request that was
+ * mapped to the calling JSP.
+ *
+ * It is only valid to call this method from a Thread
+ * executing within a _jspService(...) method of a JSP.
+ *
+ * Once this method has been called successfully, it is illegal for the
+ * calling Thread to attempt to modify the
+ * ServletResponse object. Any such attempt to do so, shall result
+ * in undefined behavior. Typically, callers immediately return from
+ * _jspService(...) after calling this method.
+ *
ServletResponse is not
+ * in a state where a forward can be performed
+ * @throws javax.servlet.ServletException if the page that was forwarded to throws
+ * a ServletException
+ * @throws java.io.IOException if an I/O error occurred while forwarding
+ */
+ @Override
+ public void forward(String relativeUrlPath) throws ServletException, IOException {
+ request.getRequestDispatcher(relativeUrlPath).forward(request, getResponse());
+ }
+
+ /**
+ * + * Causes the resource specified to be processed as part of the current + * ServletRequest and ServletResponse being processed by the calling Thread. + * The output of the target resources processing of the request is written + * directly to the ServletResponse output stream. + *
+ *+ * The current JspWriter "out" for this JSP is flushed as a side-effect + * of this call, prior to processing the include. + *
+ *
+ * If the relativeUrlPath begins with a "/" then the URL specified
+ * is calculated relative to the DOCROOT of the ServletContext
+ * for this JSP. If the path does not begin with a "/" then the URL
+ * specified is calculated relative to the URL of the request that was
+ * mapped to the calling JSP.
+ *
+ * It is only valid to call this method from a Thread
+ * executing within a _jspService(...) method of a JSP.
+ *
+ * Causes the resource specified to be processed as part of the current + * ServletRequest and ServletResponse being processed by the calling Thread. + * The output of the target resources processing of the request is written + * directly to the current JspWriter returned by a call to getOut(). + *
+ *+ * If flush is true, The current JspWriter "out" for this JSP + * is flushed as a side-effect of this call, prior to processing + * the include. Otherwise, the JspWriter "out" is not flushed. + *
+ *
+ * If the relativeUrlPath begins with a "/" then the URL specified
+ * is calculated relative to the DOCROOT of the ServletContext
+ * for this JSP. If the path does not begin with a "/" then the URL
+ * specified is calculated relative to the URL of the request that was
+ * mapped to the calling JSP.
+ *
+ * It is only valid to call this method from a Thread
+ * executing within a _jspService(...) method of a JSP.
+ *
+ * This method is intended to process an unhandled 'page' level + * exception by forwarding the exception to the specified + * error page for this JSP. If forwarding is not possible (for + * example because the response has already been committed), an + * implementation dependent mechanism should be used to invoke + * the error page (e.g. "including" the error page instead). + *
+ *
+ * If no error page is defined in the page, the exception should + * be rethrown so that the standard servlet error handling + * takes over. + *
+ *
+ * A JSP implementation class shall typically clean up any local state + * prior to invoking this and will return immediately thereafter. It is + * illegal to generate any output to the client, or to modify any + * ServletResponse state after invoking this call. + *
+ *
+ * This method is kept for backwards compatiblity reasons. Newly + * generated code should use PageContext.handlePageException(Throwable). + * + * @param e the exception to be handled + * @throws javax.servlet.ServletException if an error occurs while invoking the error page + * @throws java.io.IOException if an I/O error occurred while invoking the error + * page + * @throws NullPointerException if the exception is null + * @see #handlePageException(Throwable) + */ + @Override + public void handlePageException(Exception e) throws ServletException, IOException { + + } + + /** + *
+ * This method is intended to process an unhandled 'page' level + * exception by forwarding the exception to the specified + * error page for this JSP. If forwarding is not possible (for + * example because the response has already been committed), an + * implementation dependent mechanism should be used to invoke + * the error page (e.g. "including" the error page instead). + *
+ *
+ * If no error page is defined in the page, the exception should + * be rethrown so that the standard servlet error handling + * takes over. + *
+ *
+ * This method is intended to process an unhandled "page" level exception + * by redirecting the exception to either the specified error page for this + * JSP, or if none was specified, to perform some implementation dependent + * action. + *
+ *
+ * A JSP implementation class shall typically clean up any local state
+ * prior to invoking this and will return immediately thereafter. It is
+ * illegal to generate any output to the client, or to modify any
+ * ServletResponse state after invoking this call.
+ *
+ * @param t the throwable to be handled
+ * @throws javax.servlet.ServletException if an error occurs while invoking the error page
+ * @throws java.io.IOException if an I/O error occurred while invoking the error
+ * page
+ * @throws NullPointerException if the exception is null
+ * @see #handlePageException(Exception)
+ */
+ @Override
+ public void handlePageException(Throwable t) throws ServletException, IOException {
+
+ }
}
diff --git a/hex_utils/src/hex/utils/maps/CoercionMap.java b/hex_utils/src/hex/utils/coercion/CoercionMap.java
similarity index 99%
rename from hex_utils/src/hex/utils/maps/CoercionMap.java
rename to hex_utils/src/hex/utils/coercion/CoercionMap.java
index c337e9f..60dc1c4 100644
--- a/hex_utils/src/hex/utils/maps/CoercionMap.java
+++ b/hex_utils/src/hex/utils/coercion/CoercionMap.java
@@ -1,4 +1,4 @@
-package hex.utils.maps;
+package hex.utils.coercion;
import hex.utils.coercion.Coercible;
import hex.utils.coercion.CoercionException;
diff --git a/hex_utils/src/hex/utils/coercion/CoercionObject.java b/hex_utils/src/hex/utils/coercion/CoercionObject.java
new file mode 100644
index 0000000..34cd938
--- /dev/null
+++ b/hex_utils/src/hex/utils/coercion/CoercionObject.java
@@ -0,0 +1,40 @@
+package hex.utils.coercion;
+
+import hex.utils.Inflection;
+
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.util.Map;
+
+/**
+ * Created by jason on 15-01-03.
+ */
+public class CoercionObject implements CoercionMap