diff --git a/src/main/java/com/lhstack/TemplateApplication.java b/src/main/java/com/lhstack/TemplateApplication.java index 1a140bc6bb130d9531a923d470618ce8d783ac36..e5d2de9e0bb7186e75d8a1eee014fe78e85425ff 100644 --- a/src/main/java/com/lhstack/TemplateApplication.java +++ b/src/main/java/com/lhstack/TemplateApplication.java @@ -1,44 +1,30 @@ package com.lhstack; -import org.apache.catalina.connector.Connector; -import org.apache.coyote.http11.Http11Nio2Protocol; -import org.apache.coyote.http11.Http11Processor; -import org.apache.tomcat.util.buf.MessageBytes; +import java.lang.reflect.Method; + import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory; -import org.springframework.boot.web.server.WebServerFactoryCustomizer; -import org.springframework.context.annotation.Bean; -import org.apache.coyote.Processor; @SpringBootApplication public class TemplateApplication { public static void main(String[] args) { + + try { + // Class classes = Class.forName("com.lhstack.Test"); + // Class classes = Test.class; + Test test = new Test(); + Class classes = test.getClass(); + String methodName = "hello"; + Class paratype[] = new Class[1]; + paratype[0]=String.class; + Method method = classes.getDeclaredMethod(methodName, paratype); + method.invoke(classes.newInstance(), "testcj222m1"); + System.err.println("++++++++++++++++++"); + } catch (Exception e) { + // TODO: handle exception + } SpringApplication.run(TemplateApplication.class, args); - } - @Bean - public WebServerFactoryCustomizer webServerFactoryCustomizer(){ - return serverFactory -> { - Connector connector = new Connector(new Http11Nio2Protocol() { - @Override - protected Processor createProcessor() { - return new Http11Processor(this, this.getAdapter()) { - @Override - protected void parseHost(MessageBytes valueMB) { - MessageBytes messageBytes = MessageBytes.newInstance(); - String hostname = valueMB.toString(); - messageBytes.setString(hostname.replace("_", "-")); - messageBytes.toBytes(); - super.parseHost(messageBytes); - } - }; - } - }); - connector.setPort(8080); - serverFactory.addAdditionalTomcatConnectors(connector); - }; } - } diff --git a/src/main/java/com/lhstack/Test.java b/src/main/java/com/lhstack/Test.java new file mode 100644 index 0000000000000000000000000000000000000000..f1a266bb27350c7882c32549e3c8d65d4d421593 --- /dev/null +++ b/src/main/java/com/lhstack/Test.java @@ -0,0 +1,8 @@ +package com.lhstack; + +public class Test { + public void hello(String name){ + // int i=1/0; + System.out.println("hello,"+name); + } +} \ No newline at end of file diff --git a/target/classes/com/lhstack/TemplateApplication$1$1.class b/target/classes/com/lhstack/TemplateApplication$1$1.class deleted file mode 100644 index 89a5947e879701ba5ed0f022c3855a38dec69cd8..0000000000000000000000000000000000000000 Binary files a/target/classes/com/lhstack/TemplateApplication$1$1.class and /dev/null differ diff --git a/target/classes/com/lhstack/TemplateApplication$1.class b/target/classes/com/lhstack/TemplateApplication$1.class deleted file mode 100644 index 17f9525ba345961463c4c06934e73f9c22e47846..0000000000000000000000000000000000000000 Binary files a/target/classes/com/lhstack/TemplateApplication$1.class and /dev/null differ diff --git a/target/classes/com/lhstack/TemplateApplication.class b/target/classes/com/lhstack/TemplateApplication.class index a95b1a291d02e6843a100255b5903283002c394d..07dc4e942ffac21f20eda8373b7e24c2d564b878 100644 Binary files a/target/classes/com/lhstack/TemplateApplication.class and b/target/classes/com/lhstack/TemplateApplication.class differ diff --git a/target/classes/com/lhstack/Test.class b/target/classes/com/lhstack/Test.class new file mode 100644 index 0000000000000000000000000000000000000000..93dfcabca32996229734b6f5dc2fc3d870781488 Binary files /dev/null and b/target/classes/com/lhstack/Test.class differ diff --git a/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst b/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst index 76d74b2758967a7c267b3dd8470ce15ebe2bc1a6..5610370e3a89bd9eef0491f4713124644ecc5e1d 100644 --- a/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst +++ b/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst @@ -1,4 +1,5 @@ /root/springboot-template/src/main/java/com/lhstack/controller/CryptoController.java +/root/springboot-template/src/main/java/com/lhstack/Test.java /root/springboot-template/src/main/java/com/lhstack/utils/Aes.java /root/springboot-template/src/main/java/com/lhstack/config/WebMvcConfiguration.java /root/springboot-template/src/main/java/com/lhstack/TemplateApplication.java