Skip to content

Commit 9526fa9

Browse files
authored
upgrade to tio-boot 2.0.1 (#10063)
* update to tio-boot v1.9.7 * upgrade to tio-boot v1.9.8 * upgrade to 2.0.1
1 parent 7a34553 commit 9526fa9

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

frameworks/Java/tio-boot/pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<java.version>1.8</java.version>
1212
<maven.compiler.source>${java.version}</maven.compiler.source>
1313
<maven.compiler.target>${java.version}</maven.compiler.target>
14-
<tio-boot.version>1.9.8</tio-boot.version>
14+
<tio-boot.version>2.0.1</tio-boot.version>
1515

1616

1717
<main.class>com.litongjava.tio.http.server.MainApp</main.class>
@@ -26,7 +26,7 @@
2626
<dependency>
2727
<groupId>com.litongjava</groupId>
2828
<artifactId>java-db</artifactId>
29-
<version>1.5.0</version>
29+
<version>1.5.3</version>
3030
</dependency>
3131

3232
<dependency>

frameworks/Java/tio-boot/src/main/java/com/litongjava/tio/http/server/handler/IndexHandler.java

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
package com.litongjava.tio.http.server.handler;
22

3+
import java.nio.charset.StandardCharsets;
4+
35
import com.alibaba.fastjson2.JSON;
46
import com.litongjava.tio.boot.http.TioRequestContext;
57
import com.litongjava.tio.http.common.HttpRequest;
@@ -8,16 +10,15 @@
810
import com.litongjava.tio.http.server.model.Message;
911

1012
/**
11-
* ab -k -n1000000 -c10 http://127.0.0.1:8080/json
12-
* ab -k -n1000000 -c10 http://127.0.0.1:8080/plaintext
13+
* ab -k -n1000000 -c10 http://127.0.0.1:8080/json ab -k -n1000000 -c10
14+
* http://127.0.0.1:8080/plaintext
1315
*/
1416
public class IndexHandler {
15-
private static final String HELLO_WORLD_RN = "Hello, World!\r\n";
16-
17+
1718
private static final String HELLO_WORLD = "Hello, World!";
1819

19-
private static final byte[] HELLO_WORLD_BYTES = HELLO_WORLD_RN.getBytes();
20-
private static byte[] JSON_BYTES = JSON.toJSONBytes(new Message(HELLO_WORLD));
20+
private static final byte[] HELLO_WORLD_BYTES = HELLO_WORLD.getBytes(StandardCharsets.UTF_8);
21+
private static final byte[] JSON_BYTES = JSON.toJSONBytes(new Message(HELLO_WORLD));
2122

2223
public HttpResponse plaintext(HttpRequest request) {
2324
HttpResponse response = TioRequestContext.getResponse();

0 commit comments

Comments
 (0)