diff --git a/ng-appserver/src/main/java/ng/appserver/NGApplication.java b/ng-appserver/src/main/java/ng/appserver/NGApplication.java index 927290ce..503381b1 100644 --- a/ng-appserver/src/main/java/ng/appserver/NGApplication.java +++ b/ng-appserver/src/main/java/ng/appserver/NGApplication.java @@ -11,7 +11,6 @@ import java.util.Collections; import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Objects; import java.util.Optional; import java.util.ServiceLoader; @@ -33,6 +32,7 @@ import x.junk.NGExceptionPage; import x.junk.NGExceptionPageDevelopment; import x.junk.NGSessionTimeoutPage; +import x.junk.NGWelcomePage; /** * FIXME: Initialization still feels a little weird, while we're moving away from the way it's handled in WOApplication. Look a little more into the flow of application initialization // Hugi 2021-12-29 @@ -484,15 +484,18 @@ public NGActionResults exceptionResponse( final Throwable throwable, final NGCon * @return A default response for requests to the root. */ public NGActionResults defaultResponse( final NGRequest request ) { + return pageWithName( NGWelcomePage.class, request.context() ); + /* NGResponse response = new NGResponse( "Welcome to NGObjects!\nSorry, but I'm young and I still have no idea how to handle the default request", 404 ); response.appendContentString( "\n\nWould you like to see your request headers instead?\n\n" ); - + for( Entry> header : request.headers().entrySet() ) { response.appendContentString( header.getKey() + " : " + header.getValue() ); response.appendContentString( "\n" ); } - + return response; + */ } /** diff --git a/ng-appserver/src/main/java/x/junk/NGWelcomePage.java b/ng-appserver/src/main/java/x/junk/NGWelcomePage.java new file mode 100644 index 00000000..2b4049b8 --- /dev/null +++ b/ng-appserver/src/main/java/x/junk/NGWelcomePage.java @@ -0,0 +1,11 @@ +package x.junk; + +import ng.appserver.NGComponent; +import ng.appserver.NGContext; + +public class NGWelcomePage extends NGComponent { + + public NGWelcomePage( NGContext context ) { + super( context ); + } +} \ No newline at end of file diff --git a/ng-appserver/src/main/resources/components/NGWelcomePage.wo/NGWelcomePage.html b/ng-appserver/src/main/resources/components/NGWelcomePage.wo/NGWelcomePage.html new file mode 100644 index 00000000..fc5ac95f --- /dev/null +++ b/ng-appserver/src/main/resources/components/NGWelcomePage.wo/NGWelcomePage.html @@ -0,0 +1,18 @@ + + + + + Welcome! + + + +

Welcome to ng-objects!

+

This is the start page for a new ng-objects application.

+

Eventually it will contain something really cool and useful!

+ + \ No newline at end of file diff --git a/ng-appserver/src/main/resources/components/NGWelcomePage.wo/NGWelcomePage.wod b/ng-appserver/src/main/resources/components/NGWelcomePage.wo/NGWelcomePage.wod new file mode 100644 index 00000000..e69de29b diff --git a/ng-appserver/src/main/resources/components/NGWelcomePage.wo/NGWelcomePage.woo b/ng-appserver/src/main/resources/components/NGWelcomePage.wo/NGWelcomePage.woo new file mode 100644 index 00000000..e5207230 --- /dev/null +++ b/ng-appserver/src/main/resources/components/NGWelcomePage.wo/NGWelcomePage.woo @@ -0,0 +1,4 @@ +{ + "WebObjects Release" = "WebObjects 5.0"; + encoding = "UTF-8"; +}