diff --git a/plugin.xml b/plugin.xml
index b5c3795..0775e61 100644
--- a/plugin.xml
+++ b/plugin.xml
@@ -15,5 +15,5 @@
-
+
\ No newline at end of file
diff --git a/src/main/java/com/fr/plugin/demo/web/request/DemoRequestHandlerBridge.java b/src/main/java/com/fr/plugin/demo/web/request/DemoRequestHandlerBridge.java
index 75e1fef..6336e35 100644
--- a/src/main/java/com/fr/plugin/demo/web/request/DemoRequestHandlerBridge.java
+++ b/src/main/java/com/fr/plugin/demo/web/request/DemoRequestHandlerBridge.java
@@ -2,14 +2,16 @@ package com.fr.plugin.demo.web.request;
import com.fr.decision.fun.impl.AbstractHttpHandlerProvider;
import com.fr.decision.fun.impl.BaseHttpHandler;
-import com.fr.plugin.demo.web.request.handler.DemoHttpHandler;
+import com.fr.plugin.demo.web.request.handler.PrivateHttpHandler;
+import com.fr.plugin.demo.web.request.handler.PublicHttpHandler;
public class DemoRequestHandlerBridge extends AbstractHttpHandlerProvider {
@Override
public BaseHttpHandler[] registerHandlers() {
return new BaseHttpHandler[]{
- new DemoHttpHandler()
+ new PublicHttpHandler(),
+ new PrivateHttpHandler()
};
}
}
diff --git a/src/main/java/com/fr/plugin/demo/web/request/DemoURLAliasBridge.java b/src/main/java/com/fr/plugin/demo/web/request/DemoURLAliasBridge.java
index 77621e3..7e84413 100644
--- a/src/main/java/com/fr/plugin/demo/web/request/DemoURLAliasBridge.java
+++ b/src/main/java/com/fr/plugin/demo/web/request/DemoURLAliasBridge.java
@@ -8,7 +8,8 @@ public class DemoURLAliasBridge extends AbstractURLAliasProvider {
@Override
public URLAlias[] registerAlias() {
return new URLAlias[] {
- URLAliasFactory.createPluginAlias("/demo/text", "/demo/simple", true)
+ URLAliasFactory.createPluginAlias("/demo/simple/text", "/demo/text", true),
+ URLAliasFactory.createPluginAlias("/demo/simple/abc", "/demo/abc", false)
};
}
}
diff --git a/src/main/java/com/fr/plugin/demo/web/request/handler/PrivateHttpHandler.java b/src/main/java/com/fr/plugin/demo/web/request/handler/PrivateHttpHandler.java
new file mode 100644
index 0000000..e89d0a9
--- /dev/null
+++ b/src/main/java/com/fr/plugin/demo/web/request/handler/PrivateHttpHandler.java
@@ -0,0 +1,34 @@
+package com.fr.plugin.demo.web.request.handler;
+
+import com.fr.decision.fun.impl.BaseHttpHandler;
+import com.fr.third.springframework.web.bind.annotation.RequestMethod;
+import com.fr.web.utils.WebUtils;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.io.PrintWriter;
+
+public class PrivateHttpHandler extends BaseHttpHandler {
+ @Override
+ public RequestMethod getMethod() {
+ return RequestMethod.GET;
+ }
+
+ @Override
+ public String getPath() {
+ return "/demo/abc";
+ }
+
+ @Override
+ public boolean isPublic() {
+ return false;
+ }
+
+ @Override
+ public void handle(HttpServletRequest req, HttpServletResponse res) throws Exception {
+ PrintWriter writer = WebUtils.createPrintWriter(res);
+ writer.println("Hello, I am a private request.");
+ writer.flush();
+ writer.close();
+ }
+}
diff --git a/src/main/java/com/fr/plugin/demo/web/request/handler/DemoHttpHandler.java b/src/main/java/com/fr/plugin/demo/web/request/handler/PublicHttpHandler.java
similarity index 89%
rename from src/main/java/com/fr/plugin/demo/web/request/handler/DemoHttpHandler.java
rename to src/main/java/com/fr/plugin/demo/web/request/handler/PublicHttpHandler.java
index 315cb3a..909c1cb 100644
--- a/src/main/java/com/fr/plugin/demo/web/request/handler/DemoHttpHandler.java
+++ b/src/main/java/com/fr/plugin/demo/web/request/handler/PublicHttpHandler.java
@@ -12,7 +12,7 @@ import javax.servlet.http.HttpServletResponse;
import java.io.PrintWriter;
@EnableMetrics
-public class DemoHttpHandler extends BaseHttpHandler {
+public class PublicHttpHandler extends BaseHttpHandler {
@Override
public RequestMethod getMethod() {
@@ -33,7 +33,7 @@ public class DemoHttpHandler extends BaseHttpHandler {
@Focus(id = "com.fr.plugin.demo.web.request", text = "", source = Original.PLUGIN)
public void handle(HttpServletRequest req, HttpServletResponse res) throws Exception {
PrintWriter writer = WebUtils.createPrintWriter(res);
- writer.println("Hello, I am a test.");
+ writer.println("Hello, I am a public request.");
writer.flush();
writer.close();
}