Skip to content
Merged

2.4.2 #132

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
0259a93
fix: sub ui.data not found
ReaJason Dec 17, 2025
cdbf8bb
chore: 2.4.2-SNAPSHOT
ReaJason Dec 20, 2025
9d523c6
test: add more cases
ReaJason Dec 20, 2025
7638cf8
docs: add shellType table
ReaJason Dec 20, 2025
6388e79
docs: add WIP structure
ReaJason Dec 20, 2025
f585185
feat: support open-liberty javaee
ReaJason Dec 21, 2025
17c171f
ci: test build on windows
ReaJason Dec 24, 2025
28c9f15
feat: support addFilterFirst for tomcat
ReaJason Jan 7, 2026
d57fba6
refactor: change method order
ReaJason Jan 7, 2026
acf330f
chore: upgrade deps
ReaJason Jan 7, 2026
83a6518
build: use pip mirror
ReaJason Jan 7, 2026
c091f11
test: fix GlassFish filter
ReaJason Jan 7, 2026
b1e39f2
test: add classes
ReaJason Jan 8, 2026
8b4bdc6
test: support remote docker runner
ReaJason Jan 8, 2026
78bb37a
feat: support addFilterFirst for jetty
ReaJason Jan 8, 2026
a1cec09
refactor: simplify code
ReaJason Jan 8, 2026
30b17aa
refactor: simplify code
ReaJason Jan 8, 2026
cbfcfb8
feat: support addFilterFirst for resin
ReaJason Jan 8, 2026
87e59b4
fix: undertow filter cache
ReaJason Jan 8, 2026
5919436
feat: support addFilterFirst for undertow
ReaJason Jan 8, 2026
98bdd0d
test: add JBossAS filterProbe test
ReaJason Jan 8, 2026
7205b8d
feat: support addFilterFirst for GlassFish
ReaJason Jan 8, 2026
7fbe855
fix: classNotFound
ReaJason Jan 8, 2026
855a911
refactor: use commonUtil for packageName
ReaJason Jan 9, 2026
22bd5d0
feat: support addFilterFirst for Apusic/InforSuite
ReaJason Jan 9, 2026
b387db2
feat: support addFilterFirst for TongWeb
ReaJason Jan 9, 2026
4a2d901
refactor: simplify WebLogic getContext
ReaJason Jan 9, 2026
050a183
feat: support filterProbe for WebLogic
ReaJason Jan 10, 2026
f62daab
feat: support addFilterFirst for WebSphere
ReaJason Jan 10, 2026
9e3babc
chore: add libs git submodule
ReaJason Jan 10, 2026
ede8103
feat: support servletNameFilter for TomcatFilterProbe
ReaJason Jan 10, 2026
90b9116
feat: support servletNameFilter for JettyFilterProbe
ReaJason Jan 10, 2026
1166036
feat: support servletNameFilter for GlassFishFilterProbe
ReaJason Jan 11, 2026
3de0700
feat: support servletNameFilter for UndertowFilterProbe
ReaJason Jan 11, 2026
a1bab09
feat: support servletNameFilter for WebLogicFilterProbe
ReaJason Jan 11, 2026
3dfeb32
feat: support servletNameFilter
ReaJason Jan 11, 2026
3b1ce35
refactor: simplify code
ReaJason Jan 11, 2026
3e70d4a
feat: support FilterProbe generate
ReaJason Jan 11, 2026
f4a5dd3
fix: context not found test not work
ReaJason Jan 11, 2026
a77d251
fix: NPE
ReaJason Jan 11, 2026
499e5f2
docs: update changelog
ReaJason Jan 11, 2026
9049fb9
chore: update libs
ReaJason Jan 11, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 12 additions & 3 deletions .github/workflows/dev-deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@ on:
jobs:
build-jar:
name: Build Jar
runs-on: ubuntu-latest
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4

Expand All @@ -39,10 +42,16 @@ jobs:
working-directory: web
run: bun install --frozen-lockfile && bun run build

- name: Build Boot with Gradle
- name: Build Boot with Gradle (Linux)
if: matrix.os == 'ubuntu-latest'
run: ./gradlew :boot:test :boot:bootjar

- name: Upload Boot Jar
- name: Build Boot with Gradle (Windows)
if: matrix.os == 'windows-latest'
run: ./gradlew.bat :boot:test :boot:bootjar

- name: Upload Boot Jar (Linux)
if: matrix.os == 'ubuntu-latest'
uses: actions/upload-artifact@v4
with:
name: boot
Expand Down
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "libs"]
path = libs
url = https://github.com/ReaJason/javaweb-sources.git
2 changes: 1 addition & 1 deletion asserts/neoreg/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ FROM python:3.12-slim

WORKDIR /app

RUN pip install requests
RUN pip install requests -i https://pypi.tuna.tsinghua.edu.cn/simple/

COPY neoreg.py .

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@

import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import lombok.SneakyThrows;
import lombok.extern.slf4j.Slf4j;
import org.springframework.core.io.ClassPathResource;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Controller;
import org.springframework.util.FileCopyUtils;
import org.springframework.web.bind.annotation.GetMapping;
Expand Down Expand Up @@ -34,23 +35,18 @@ public String handleSearch(HttpServletRequest request, HttpServletResponse respo
return renderFileData(relativePath, response);
}

@GetMapping({"/ui/docs/*.data", "/ui/*.data"})
@ResponseBody
public String handleDataFile(HttpServletRequest request, HttpServletResponse response) throws IOException {
String fullPath = request.getRequestURI().replace(request.getContextPath(), "");
String relativePath = fullPath.substring(4);
return renderFileData(relativePath, response);
}


@GetMapping("/ui/**")
public String handleHtmlView(HttpServletRequest request) {
@SneakyThrows
public Object handleView(HttpServletRequest request, HttpServletResponse response) {
String fullPath = request.getRequestURI().replace(request.getContextPath(), "");
if ("/ui".equals(fullPath) || "/ui/".equals(fullPath)) {
return "index";
}
String viewPath = fullPath.substring(4);
return viewPath + "/index";
String docPath = fullPath.substring(4);
if (docPath.endsWith(".data")) {
return ResponseEntity.ok(renderFileData(docPath, response));
}
return docPath + "/index";
}

private String renderFileData(String relativePath, HttpServletResponse response) {
Expand All @@ -61,8 +57,6 @@ private String renderFileData(String relativePath, HttpServletResponse response)
response.setStatus(HttpServletResponse.SC_NOT_FOUND);
return "File not found: " + relativePath;
}
response.setContentType(MediaType.TEXT_PLAIN_VALUE);
response.setCharacterEncoding("UTF-8");
InputStreamReader reader = new InputStreamReader(
resource.getInputStream(),
StandardCharsets.UTF_8
Expand Down
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ idea {
}
}

version = "2.4.1"
version = "2.4.2-SNAPSHOT"

tasks.register("publishAllToMavenCentral") {
dependsOn(":memshell-party-common:publishToMavenCentral")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.util.HashSet;
import java.util.LinkedHashSet;
import java.util.Map;
import java.util.Set;
import java.util.zip.GZIPInputStream;
Expand Down Expand Up @@ -43,7 +44,7 @@ public ApusicFilterInjector() {
} catch (Throwable throwable) {
msg += "context error: " + getErrorMessage(throwable);
}
if (contexts == null) {
if (contexts == null || contexts.isEmpty()) {
msg += "context not found";
} else {
for (Object context : contexts) {
Expand Down Expand Up @@ -145,7 +146,12 @@ public void inject(Object context, Object filter) throws Exception {
Object filterMapping = filterMappingClass.newInstance();
invokeMethod(filterMapping, "setUrlPattern", new Class[]{String.class}, new Object[]{getUrlPattern()});
invokeMethod(filterMapping, "setFilterName", new Class[]{String.class}, new Object[]{getClassName()});
invokeMethod(webModule, "addBeforeFilterMapping", new Class[]{filterMappingClass}, new Object[]{filterMapping});
LinkedHashSet beforeFilterMappings = (LinkedHashSet) getFieldValue(webModule, "beforeFilterMappings");
LinkedHashSet newSet = new LinkedHashSet();
newSet.add(filterMapping);
newSet.addAll(beforeFilterMappings);
beforeFilterMappings.clear();
beforeFilterMappings.addAll(newSet);

// addFilterModel
invokeMethod(webModule, "addFilter", new Class[]{String.class, String.class}, new Object[]{getClassName(), getClassName()});
Expand Down Expand Up @@ -218,30 +224,25 @@ public static Field getField(Object obj, String fieldName) throws NoSuchFieldExc
}

@SuppressWarnings("all")
public static Object invokeMethod(Object obj, String methodName, Class<?>[] paramClazz, Object[] param) {
try {
Class<?> clazz = (obj instanceof Class) ? (Class<?>) obj : obj.getClass();
Method method = null;
while (clazz != null && method == null) {
try {
if (paramClazz == null) {
method = clazz.getDeclaredMethod(methodName);
} else {
method = clazz.getDeclaredMethod(methodName, paramClazz);
}
} catch (NoSuchMethodException e) {
clazz = clazz.getSuperclass();
public static Object invokeMethod(Object obj, String methodName, Class<?>[] paramClazz, Object[] param) throws Exception {
Class<?> clazz = (obj instanceof Class) ? (Class<?>) obj : obj.getClass();
Method method = null;
while (clazz != null && method == null) {
try {
if (paramClazz == null) {
method = clazz.getDeclaredMethod(methodName);
} else {
method = clazz.getDeclaredMethod(methodName, paramClazz);
}
} catch (NoSuchMethodException e) {
clazz = clazz.getSuperclass();
}
if (method == null) {
throw new NoSuchMethodException("Method not found: " + methodName);
}

method.setAccessible(true);
return method.invoke(obj instanceof Class ? null : obj, param);
} catch (Exception e) {
throw new RuntimeException("Error invoking method: " + methodName, e);
}
if (method == null) {
throw new NoSuchMethodException("Method not found: " + methodName);
}
method.setAccessible(true);
return method.invoke(obj instanceof Class ? null : obj, param);
}

@SuppressWarnings("all")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public ApusicListenerInjector() {
} catch (Throwable throwable) {
msg += "context error: " + getErrorMessage(throwable);
}
if (contexts == null) {
if (contexts == null || contexts.isEmpty()) {
msg += "context not found";
} else {
for (Object context : contexts) {
Expand Down Expand Up @@ -197,30 +197,25 @@ public static Field getField(Object obj, String fieldName) throws NoSuchFieldExc
}

@SuppressWarnings("all")
public static Object invokeMethod(Object obj, String methodName, Class<?>[] paramClazz, Object[] param) {
try {
Class<?> clazz = (obj instanceof Class) ? (Class<?>) obj : obj.getClass();
Method method = null;
while (clazz != null && method == null) {
try {
if (paramClazz == null) {
method = clazz.getDeclaredMethod(methodName);
} else {
method = clazz.getDeclaredMethod(methodName, paramClazz);
}
} catch (NoSuchMethodException e) {
clazz = clazz.getSuperclass();
public static Object invokeMethod(Object obj, String methodName, Class<?>[] paramClazz, Object[] param) throws Exception {
Class<?> clazz = (obj instanceof Class) ? (Class<?>) obj : obj.getClass();
Method method = null;
while (clazz != null && method == null) {
try {
if (paramClazz == null) {
method = clazz.getDeclaredMethod(methodName);
} else {
method = clazz.getDeclaredMethod(methodName, paramClazz);
}
} catch (NoSuchMethodException e) {
clazz = clazz.getSuperclass();
}
if (method == null) {
throw new NoSuchMethodException("Method not found: " + methodName);
}

method.setAccessible(true);
return method.invoke(obj instanceof Class ? null : obj, param);
} catch (Exception e) {
throw new RuntimeException("Error invoking method: " + methodName, e);
}
if (method == null) {
throw new NoSuchMethodException("Method not found: " + methodName);
}
method.setAccessible(true);
return method.invoke(obj instanceof Class ? null : obj, param);
}

@SuppressWarnings("all")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public ApusicServletInjector() {
} catch (Throwable throwable) {
msg += "context error: " + getErrorMessage(throwable);
}
if (contexts == null) {
if (contexts == null || contexts.isEmpty()) {
msg += "context not found";
} else {
for (Object context : contexts) {
Expand Down Expand Up @@ -198,30 +198,25 @@ public static Field getField(Object obj, String fieldName) throws NoSuchFieldExc
}

@SuppressWarnings("all")
public static Object invokeMethod(Object obj, String methodName, Class<?>[] paramClazz, Object[] param) {
try {
Class<?> clazz = (obj instanceof Class) ? (Class<?>) obj : obj.getClass();
Method method = null;
while (clazz != null && method == null) {
try {
if (paramClazz == null) {
method = clazz.getDeclaredMethod(methodName);
} else {
method = clazz.getDeclaredMethod(methodName, paramClazz);
}
} catch (NoSuchMethodException e) {
clazz = clazz.getSuperclass();
public static Object invokeMethod(Object obj, String methodName, Class<?>[] paramClazz, Object[] param) throws Exception {
Class<?> clazz = (obj instanceof Class) ? (Class<?>) obj : obj.getClass();
Method method = null;
while (clazz != null && method == null) {
try {
if (paramClazz == null) {
method = clazz.getDeclaredMethod(methodName);
} else {
method = clazz.getDeclaredMethod(methodName, paramClazz);
}
} catch (NoSuchMethodException e) {
clazz = clazz.getSuperclass();
}
if (method == null) {
throw new NoSuchMethodException("Method not found: " + methodName);
}

method.setAccessible(true);
return method.invoke(obj instanceof Class ? null : obj, param);
} catch (Exception e) {
throw new RuntimeException("Error invoking method: " + methodName, e);
}
if (method == null) {
throw new NoSuchMethodException("Method not found: " + methodName);
}
method.setAccessible(true);
return method.invoke(obj instanceof Class ? null : obj, param);
}

@SuppressWarnings("all")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public BesFilterInjector() {
} catch (Throwable throwable) {
msg += "context error: " + getErrorMessage(throwable);
}
if (contexts == null) {
if (contexts == null || contexts.isEmpty()) {
msg += "context not found";
} else {
for (Object context : contexts) {
Expand Down Expand Up @@ -105,7 +105,7 @@ public Set<Object> getContext() throws Exception {
return contexts;
}

private ClassLoader getWebAppClassLoader(Object context) {
private ClassLoader getWebAppClassLoader(Object context) throws Exception {
try {
return ((ClassLoader) invokeMethod(context, "getClassLoader", null, null));
} catch (Exception e) {
Expand Down Expand Up @@ -218,30 +218,25 @@ public static Field getField(Object obj, String fieldName) throws NoSuchFieldExc
}

@SuppressWarnings("all")
public static Object invokeMethod(Object obj, String methodName, Class<?>[] paramClazz, Object[] param) {
try {
Class<?> clazz = (obj instanceof Class) ? (Class<?>) obj : obj.getClass();
Method method = null;
while (clazz != null && method == null) {
try {
if (paramClazz == null) {
method = clazz.getDeclaredMethod(methodName);
} else {
method = clazz.getDeclaredMethod(methodName, paramClazz);
}
} catch (NoSuchMethodException e) {
clazz = clazz.getSuperclass();
public static Object invokeMethod(Object obj, String methodName, Class<?>[] paramClazz, Object[] param) throws Exception {
Class<?> clazz = (obj instanceof Class) ? (Class<?>) obj : obj.getClass();
Method method = null;
while (clazz != null && method == null) {
try {
if (paramClazz == null) {
method = clazz.getDeclaredMethod(methodName);
} else {
method = clazz.getDeclaredMethod(methodName, paramClazz);
}
} catch (NoSuchMethodException e) {
clazz = clazz.getSuperclass();
}
if (method == null) {
throw new NoSuchMethodException("Method not found: " + methodName);
}

method.setAccessible(true);
return method.invoke(obj instanceof Class ? null : obj, param);
} catch (Exception e) {
throw new RuntimeException("Error invoking method: " + methodName, e);
}
if (method == null) {
throw new NoSuchMethodException("Method not found: " + methodName);
}
method.setAccessible(true);
return method.invoke(obj instanceof Class ? null : obj, param);
}

@SuppressWarnings("all")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public BesListenerInjector() {
} catch (Throwable throwable) {
msg += "context error: " + getErrorMessage(throwable);
}
if (contexts == null) {
if (contexts == null || contexts.isEmpty()) {
msg += "context not found";
} else {
for (Object context : contexts) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public BesValveInjector() {
} catch (Throwable throwable) {
msg += "context error: " + getErrorMessage(throwable);
}
if (contexts == null) {
if (contexts == null || contexts.isEmpty()) {
msg += "context not found";
} else {
for (Object context : contexts) {
Expand Down
Loading