王子豪

Results 62 comments of 王子豪
trafficstars

下面这个问题. 这个是spring处理完后, 会帮你序列化, 然后response.getOutputStream().write(byte[]), 因为spring默认实现了一个servlet. 还有返回的生成数据,是在哪个地方被 ctx.write 的。

这个静态文件的内置功能, 目前没有, 但是spring有, 如果不想用spring, 可以手工写一个或者网上copy一个 FileServlet, 即可 比如 处理所有 /static/ 目录下的静态文件, 可以加一个这样的servlet 我想了解的是否有 HTML file request 支持,而不仅仅是 servlet. 例如: http://server_address/.../xxx.html 现在有内置支持功能吗?

没有特别之处, 这个方法会影响到使用吗? 我可以补上

我刚发布了2.2.4版本, 加了HttpServletRequest#getPathInfo方法实现. 应该可以满足你的要求. 现在除了request.login 系列的接口, 其他的都与tomcat保持一致了 发布2.2.4 1.增加HttpServletRequest#getPathInfo方法实现 2.修复springboot访问localhost时, 没有访问到index.html的问题 3.修复servlet异步时,客户端强制abort中止后,使用request对象会报空指针的bug. 4.修复forward,async,include时.获取requestURI路径不正确的bug fix https://github.com/wangzihaogithub/spring-boot-protocol/issues/16

我明白了你的意图, 改好后告诉你. I understand what you're trying to do. I'll let you know when I fix it

我刚发布了2.2.5版本, 应该过1~2天就自动同步到maven中央仓库了. 代码这样写就可以了. ` public static void main(String[] args) { StartupServer server = new StartupServer(80); server.addProtocol(newHttpProtocol()); server.start(); } private static HttpServletProtocol newHttpProtocol() { ServletContext servletContext = new ServletContext(); servletContext.setDocBase("D://demo", "/webapp");...

rpc/netty-message demo ` package com.github.netty.javanrpc.server; // server demo public class RpcServerApplication { public static void main(String[] args) { StartupServer server = new StartupServer(80); server.addProtocol(newHttpProtocol()); server.addProtocol(newRpcMessageProtocol()); server.start(); } private static NRpcProtocol...

我这里并没有用java9的模块话拆分, 所以即使升级到java9也是没问题的 测试过java9, 可以正常使用. artifactId是固定的, 我是不会改的 I'm not using java9 modules here, so upgrading to java9 is fine Java9 has been tested and can be used normally. ArtifactId is fixed,...

demo ` // rpc client demo public class RpcClientApplication { public static void main(String[] args){ RpcClient rpcClient = new RpcClient("localhost", 80); DemoClient demoClient = rpcClient.newInstance(DemoClient.class); DemoMessageClient demoMessageClient = rpcClient.newInstance(DemoMessageClient.class); DemoAsyncClient...

这段代码不需要spring-boot, 只需要引入自己即可, 并且版本号大于等于2.2.6, 其他都不需要. com.github.wangzihaogithub spring-boot-protocol 2.2.6