From 26d6a09cc295a67b203133e52685fd0b42aa2abe Mon Sep 17 00:00:00 2001
From: Juho Jeong
Date: Sat, 11 Jan 2025 15:11:19 +0900
Subject: [PATCH] Update
---
.../aspectran/aspectow/appmon/AboutMe.java | 2 +-
demo/app/config/root-web-config.xml | 2 +-
.../appmon/WEB-INF/jsp/appmon/appmon.jsp | 12 +++---
.../appmon/WEB-INF/jsp/templates/default.jsp | 41 +++---------------
.../root/WEB-INF/jsp/templates/default.jsp | 2 +-
.../aspectow/appmon/FrontAction.java | 43 +++++++++++++++----
6 files changed, 51 insertions(+), 51 deletions(-)
diff --git a/backend/src/main/java/com/aspectran/aspectow/appmon/AboutMe.java b/backend/src/main/java/com/aspectran/aspectow/appmon/AboutMe.java
index 846f50e..597cefe 100644
--- a/backend/src/main/java/com/aspectran/aspectow/appmon/AboutMe.java
+++ b/backend/src/main/java/com/aspectran/aspectow/appmon/AboutMe.java
@@ -40,7 +40,7 @@ public abstract class AboutMe {
pkg.getImplementationVersion() != null) {
VERSION = pkg.getImplementationVersion();
} else {
- VERSION = System.getProperty("appmon.version", "1.0.x");
+ VERSION = System.getProperty("appmon.version", "1.0.x(20250111)");
}
POWERED_BY = "Powered by Aspectran " + VERSION;
diff --git a/demo/app/config/root-web-config.xml b/demo/app/config/root-web-config.xml
index 1f6eabd..13c7669 100644
--- a/demo/app/config/root-web-config.xml
+++ b/demo/app/config/root-web-config.xml
@@ -35,7 +35,7 @@
-
+
diff --git a/demo/app/webapps/appmon/WEB-INF/jsp/appmon/appmon.jsp b/demo/app/webapps/appmon/WEB-INF/jsp/appmon/appmon.jsp
index bdda53e..955ca5a 100644
--- a/demo/app/webapps/appmon/WEB-INF/jsp/appmon/appmon.jsp
+++ b/demo/app/webapps/appmon/WEB-INF/jsp/appmon/appmon.jsp
@@ -1,12 +1,12 @@
<%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://aspectran.com/tags" prefix="aspectran" %>
-">
-">
-">
-">
-">
-">
+">
+">
+">
+">
+">
+">
diff --git a/demo/app/webapps/appmon/WEB-INF/jsp/templates/default.jsp b/demo/app/webapps/appmon/WEB-INF/jsp/templates/default.jsp
index 6d74e2b..7bfe40c 100644
--- a/demo/app/webapps/appmon/WEB-INF/jsp/templates/default.jsp
+++ b/demo/app/webapps/appmon/WEB-INF/jsp/templates/default.jsp
@@ -8,8 +8,8 @@
- ${empty page.title ? "Aspectow Demo" : page.title}
-
+ ${empty page.title ? "AppMon" : page.title}
+
@@ -39,7 +39,7 @@
" title="Aspectran">
@@ -53,45 +53,18 @@
-
-
@@ -133,7 +106,7 @@
diff --git a/demo/app/webapps/root/WEB-INF/jsp/templates/default.jsp b/demo/app/webapps/root/WEB-INF/jsp/templates/default.jsp
index eb293ec..70e3a17 100644
--- a/demo/app/webapps/root/WEB-INF/jsp/templates/default.jsp
+++ b/demo/app/webapps/root/WEB-INF/jsp/templates/default.jsp
@@ -53,7 +53,7 @@
diff --git a/front/src/main/java/com/aspectran/aspectow/appmon/FrontAction.java b/front/src/main/java/com/aspectran/aspectow/appmon/FrontAction.java
index f15885b..9b2eb2a 100644
--- a/front/src/main/java/com/aspectran/aspectow/appmon/FrontAction.java
+++ b/front/src/main/java/com/aspectran/aspectow/appmon/FrontAction.java
@@ -16,21 +16,28 @@
package com.aspectran.aspectow.appmon;
import com.aspectran.aspectow.appmon.manager.AppMonManager;
+import com.aspectran.core.activity.Translet;
import com.aspectran.core.component.bean.annotation.Action;
import com.aspectran.core.component.bean.annotation.Autowired;
import com.aspectran.core.component.bean.annotation.Component;
import com.aspectran.core.component.bean.annotation.Dispatch;
import com.aspectran.core.component.bean.annotation.Request;
import com.aspectran.utils.StringUtils;
+import com.aspectran.utils.annotation.jsr305.NonNull;
+import com.aspectran.utils.logging.Logger;
+import com.aspectran.utils.logging.LoggerFactory;
+import com.aspectran.utils.security.InvalidPBTokenException;
import java.util.Map;
/**
*
Created: 2020/02/23
*/
-@Component("/front")
+@Component
public class FrontAction {
+ private static final Logger logger = LoggerFactory.getLogger(FrontAction.class);
+
private final AppMonManager appMonManager;
@Autowired
@@ -38,16 +45,36 @@ public FrontAction(AppMonManager appMonManager) {
this.appMonManager = appMonManager;
}
- @Request("/${endpoint}")
+ @Request("/")
+ @Dispatch("templates/default")
+ @Action("page")
+ public Map
home() {
+ return Map.of(
+ "include", "home/main",
+ "style", "fluid compact"
+ );
+ }
+
+ @Request("/front/${token}/${endpoint}")
@Dispatch("templates/default")
@Action("page")
- public Map front(String endpoint) {
+ public Map front(@NonNull Translet translet, String token, String endpoint) {
+ try {
+ appMonManager.validateToken(token);
+ } catch (InvalidPBTokenException e) {
+ if (logger.isDebugEnabled()) {
+ logger.debug(e);
+ }
+ translet.redirect("../../../");
+ return null;
+ }
return Map.of(
- "headinclude", "appmon/_endpoints",
- "include", "appmon/appmon",
- "style", "fluid compact",
- "token", appMonManager.issueToken(),
- "endpoint", StringUtils.nullToEmpty(endpoint)
+ "version", AboutMe.getVersion(),
+ "headinclude", "appmon/_endpoints",
+ "include", "appmon/appmon",
+ "style", "fluid compact",
+ "token", appMonManager.issueToken(),
+ "endpoint", StringUtils.nullToEmpty(endpoint)
);
}