From 59b10ba33f4c0b1d399b5d31b7a07380abb62677 Mon Sep 17 00:00:00 2001 From: Benjamin Culkin Date: Tue, 21 May 2024 17:04:17 -0400 Subject: Work on getting a running example This current version does deploy correctly and run, but it doesn't display correctly --- wotonomy-test/src/main/java/DirectAction.java | 71 +++++++++++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 wotonomy-test/src/main/java/DirectAction.java (limited to 'wotonomy-test/src/main/java/DirectAction.java') diff --git a/wotonomy-test/src/main/java/DirectAction.java b/wotonomy-test/src/main/java/DirectAction.java new file mode 100644 index 0000000..f5dc851 --- /dev/null +++ b/wotonomy-test/src/main/java/DirectAction.java @@ -0,0 +1,71 @@ + +import java.io.PrintStream; +import java.util.Date; +import net.wotonomy.foundation.NSArray; +import net.wotonomy.foundation.NSDictionary; +import net.wotonomy.web.*; + +public class DirectAction extends WODirectAction { + + private Date testing; + + public DirectAction(WORequest aRequest) { + super(aRequest); + testing = new Date(); + System.out.println("DirectAction()"); + } + + public WOActionResults defaultAction() { + return pageWithName("Main"); + } + + public Object getTesting() { + return testing; + } + + public void setTesting(Date anObject) { + testing = anObject; + } + + public WOActionResults testAction() { + System.out.println("DirectAction.testAction()"); + takeFormValuesForKeyArray(request().formValues().allKeys()); + WOResponse response = new WOResponse(); + response.appendContentString("This is really just a test."); + response.appendContentString("

"); + response.appendContentString(Application.application().name()); + response.appendContentString("

"); + response.appendContentHTMLString("

"); + response.appendContentString("

"); + response.appendContentString(getTesting().toString()); + response.appendContentString("

"); + response.appendContentString(request().formValues().toString()); + response.appendContentString("

"); + response.appendContentString("browserLanguages: "); + response.appendContentString(request().browserLanguages().toString()); + response.appendContentString("

"); + response.appendContentString("uri: "); + response.appendContentString(request().uri().toString()); + response.appendContentString("

"); + response.appendContentString("adaptorPrefix: "); + response.appendContentString(request().adaptorPrefix().toString()); + response.appendContentString("

"); + response.appendContentString("applicationName: "); + response.appendContentString(request().applicationName().toString()); + response.appendContentString("

"); + response.appendContentString("requestHandlerKey: "); + response.appendContentString(request().requestHandlerKey().toString()); + response.appendContentString("

"); + response.appendContentString("requestHandlerPath: "); + response.appendContentString(request().requestHandlerPath().toString()); + response.appendContentString("

"); + response.appendContentString("requestHandlerPathArray: "); + response.appendContentString(request().requestHandlerPathArray().toString()); + response.appendContentString("

"); + response.appendContentString("method: "); + response.appendContentString(request().method().toString()); + response.appendContentString("

"); + response.appendContentString("content: "); + return response; + } +} -- cgit v1.2.3