From d45a1f645576ef06ab4e1f03912c911dd9e0fca5 Mon Sep 17 00:00:00 2001 From: rsonghuster Date: Mon, 3 Apr 2023 23:24:00 +0800 Subject: [PATCH] fix java11 --- event-function/fc-event-java11/publish.yaml | 2 +- event-function/fc-event-java11/src/pom.xml | 2 ++ .../fc-event-java11/src/src/main/java/example/App.java | 3 +-- http-function/fc-http-java11/publish.yaml | 2 +- http-function/fc-http-java11/src/pom.xml | 2 ++ .../fc-http-java11/src/src/main/java/example/App.java | 7 +++---- 6 files changed, 10 insertions(+), 8 deletions(-) diff --git a/event-function/fc-event-java11/publish.yaml b/event-function/fc-event-java11/publish.yaml index fa6e9e9..a5a2cca 100644 --- a/event-function/fc-event-java11/publish.yaml +++ b/event-function/fc-event-java11/publish.yaml @@ -1,6 +1,6 @@ Type: Application Name: start-fc-event-java11 -Version: 0.0.1 +Version: 0.0.2 Provider: - 阿里云 Description: 快速部署一个 Java 11 的 Event 类型的 Hello World 函数到阿里云函数计算。 diff --git a/event-function/fc-event-java11/src/pom.xml b/event-function/fc-event-java11/src/pom.xml index 9ed86a1..f24d995 100644 --- a/event-function/fc-event-java11/src/pom.xml +++ b/event-function/fc-event-java11/src/pom.xml @@ -45,6 +45,8 @@ 11 + 11 + 11 true diff --git a/event-function/fc-event-java11/src/src/main/java/example/App.java b/event-function/fc-event-java11/src/src/main/java/example/App.java index 5df5bca..7fba8b3 100644 --- a/event-function/fc-event-java11/src/src/main/java/example/App.java +++ b/event-function/fc-event-java11/src/src/main/java/example/App.java @@ -15,10 +15,9 @@ public class App implements StreamRequestHandler, FunctionInitializer { public void initialize(Context context) throws IOException { - //TODO + // TODO } - @Override public void handleRequest( InputStream inputStream, OutputStream outputStream, Context context) throws IOException { outputStream.write(new String("hello world\n").getBytes()); diff --git a/http-function/fc-http-java11/publish.yaml b/http-function/fc-http-java11/publish.yaml index 945a196..4c8dc9d 100644 --- a/http-function/fc-http-java11/publish.yaml +++ b/http-function/fc-http-java11/publish.yaml @@ -1,6 +1,6 @@ Type: Application Name: start-fc-http-java11 -Version: 0.0.1 +Version: 0.0.2 Provider: - 阿里云 Description: 快速部署一个 Java 8 的 HTTP 类型的 Hello World 函数到阿里云函数计算。 diff --git a/http-function/fc-http-java11/src/pom.xml b/http-function/fc-http-java11/src/pom.xml index 9ed86a1..f24d995 100644 --- a/http-function/fc-http-java11/src/pom.xml +++ b/http-function/fc-http-java11/src/pom.xml @@ -45,6 +45,8 @@ 11 + 11 + 11 true diff --git a/http-function/fc-http-java11/src/src/main/java/example/App.java b/http-function/fc-http-java11/src/src/main/java/example/App.java index 3e6a382..905c5e7 100644 --- a/http-function/fc-http-java11/src/src/main/java/example/App.java +++ b/http-function/fc-http-java11/src/src/main/java/example/App.java @@ -17,16 +17,15 @@ public class App implements HttpRequestHandler, FunctionInitializer { public void initialize(Context context) throws IOException { - //TODO + // TODO } - @Override public void handleRequest(HttpServletRequest request, HttpServletResponse response, Context context) throws IOException, ServletException { String requestPath = (String) request.getAttribute("FC_REQUEST_PATH"); String requestURI = (String) request.getAttribute("FC_REQUEST_URI"); - String requestClientIP = (String) request.getAttribute("FC_REQUEST_CLIENT_IP"); - + String requestClientIP = (String) request.getAttribute("FC_REQUEST_CLIENT_IP"); + response.setStatus(200); response.setHeader("header1", "value1"); response.setHeader("header2", "value2");