diff options
| author | Benjamin Culkin <scorpress@gmail.com> | 2024-10-13 17:16:30 -0400 |
|---|---|---|
| committer | Benjamin Culkin <scorpress@gmail.com> | 2024-10-13 17:16:30 -0400 |
| commit | ab37f52711db817f1d59dbe2465d65ce9b4b936e (patch) | |
| tree | c86a356ea8d01cacab02357d48f8708d2c3b61f4 /projects/net.wotonomy.web/src/main/java/net | |
| parent | 25bd1dca3bd0032a70472c4d7354be70b50a7ff2 (diff) | |
Enhance logging for resources
Add some additional logging that I used to better figure out how
resources are loaded
Diffstat (limited to 'projects/net.wotonomy.web/src/main/java/net')
4 files changed, 11 insertions, 4 deletions
diff --git a/projects/net.wotonomy.web/src/main/java/net/wotonomy/web/WOApplication.java b/projects/net.wotonomy.web/src/main/java/net/wotonomy/web/WOApplication.java index 6103b0d..5e28a40 100644 --- a/projects/net.wotonomy.web/src/main/java/net/wotonomy/web/WOApplication.java +++ b/projects/net.wotonomy.web/src/main/java/net/wotonomy/web/WOApplication.java @@ -260,7 +260,8 @@ public class WOApplication extends HttpServlet { * Dispatches the request to the appropriate handler. */ public WOResponse dispatchRequest(WORequest aRequest) { - return handlerForRequest(aRequest).handleRequest(aRequest); + WORequestHandler handlerForRequest = handlerForRequest(aRequest); + return handlerForRequest.handleRequest(aRequest); } // request handling @@ -322,7 +323,11 @@ public class WOApplication extends HttpServlet { if (aRequest == null) result = defaultRequestHandler(); // TODO verify it was correct to move this down one - result = requestHandlerForKey(aRequest.requestHandlerKey()); + String requestHandlerKey = aRequest.requestHandlerKey(); + result = requestHandlerForKey(requestHandlerKey); + if (result == null) { + System.err.println("Unable to find request handler for key " + requestHandlerKey); + } return result; } diff --git a/projects/net.wotonomy.web/src/main/java/net/wotonomy/web/WOComponent.java b/projects/net.wotonomy.web/src/main/java/net/wotonomy/web/WOComponent.java index a5157fe..69b1118 100644 --- a/projects/net.wotonomy.web/src/main/java/net/wotonomy/web/WOComponent.java +++ b/projects/net.wotonomy.web/src/main/java/net/wotonomy/web/WOComponent.java @@ -180,7 +180,7 @@ public class WOComponent extends WOElement implements WOActionResults, net.woton return null; WOElement result = null; try { - NSDictionary<String, WOElementBindings> bindings = processDeclaration(aDeclaration); + NSDictionary<String, WOElementBindings> bindings = processDeclaration(aDeclaration.trim()); List<WOElement> elements = new LinkedList<>(); int index = processTemplate(elements, anHTMLString, 0, bindings, aLanguageList); if (index == -1) { diff --git a/projects/net.wotonomy.web/src/main/java/net/wotonomy/web/WOResourceManager.java b/projects/net.wotonomy.web/src/main/java/net/wotonomy/web/WOResourceManager.java index 170af3b..c60a6b3 100644 --- a/projects/net.wotonomy.web/src/main/java/net/wotonomy/web/WOResourceManager.java +++ b/projects/net.wotonomy.web/src/main/java/net/wotonomy/web/WOResourceManager.java @@ -341,7 +341,8 @@ public class WOResourceManager { return result; } - private static final InputStream getStream(String path) { // System.out.println( "getStream: " + path ); + private static final InputStream getStream(String path) { + //System.err.println( "Querying for resource: " + path ); InputStream input = WOApplication.application().getClass().getResourceAsStream(path); if (input == null) { // in case the local class loader doesn't delegate to its parent diff --git a/projects/net.wotonomy.web/src/main/java/net/wotonomy/web/WOResourceRequestHandler.java b/projects/net.wotonomy.web/src/main/java/net/wotonomy/web/WOResourceRequestHandler.java index 876052b..6991d9e 100644 --- a/projects/net.wotonomy.web/src/main/java/net/wotonomy/web/WOResourceRequestHandler.java +++ b/projects/net.wotonomy.web/src/main/java/net/wotonomy/web/WOResourceRequestHandler.java @@ -69,6 +69,7 @@ public class WOResourceRequestHandler extends WORequestHandler { String resource; if (buf.length() > 0) { resource = buf.toString(); + System.err.printf("Querying for resource '%s' in framework '%s'\n", resource, framework); byte[] data = resourceManager.bytesForResourceNamed(resource, framework, aRequest.browserLanguages()); if (data != null) { response.setHeader(resourceManager.contentTypeForResourceNamed(resource), "Content-Type"); |
