Skip to content

Commit

Permalink
Merge pull request #75 from devsapp/fix-java11
Browse files Browse the repository at this point in the history
fix java11
  • Loading branch information
rsonghuster authored Apr 3, 2023
2 parents 180b4d4 + d45a1f6 commit ae548a6
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 8 deletions.
2 changes: 1 addition & 1 deletion event-function/fc-event-java11/publish.yaml
Original file line number Diff line number Diff line change
@@ -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 函数到阿里云函数计算。
Expand Down
2 changes: 2 additions & 0 deletions event-function/fc-event-java11/src/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@

<properties>
<maven.compiler.release>11</maven.compiler.release>
<maven.compiler.target>11</maven.compiler.target>
<maven.compiler.source>11</maven.compiler.source>
<maven.test.skip>true</maven.test.skip>
</properties>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down
2 changes: 1 addition & 1 deletion http-function/fc-http-java11/publish.yaml
Original file line number Diff line number Diff line change
@@ -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 函数到阿里云函数计算。
Expand Down
2 changes: 2 additions & 0 deletions http-function/fc-http-java11/src/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@

<properties>
<maven.compiler.release>11</maven.compiler.release>
<maven.compiler.target>11</maven.compiler.target>
<maven.compiler.source>11</maven.compiler.source>
<maven.test.skip>true</maven.test.skip>
</properties>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down

0 comments on commit ae548a6

Please sign in to comment.