Comments (13)
我看了下你修复合包的那个问题的提交,感觉这里有点问题。然后在HttpServletProtocol的ChannelPipeline最前面加了一个ChannelInboundHandlerAdapter,在里面构造DefaultFullHttpRequest向下传递,可以复现这个问题。
from spring-boot-protocol.
好吧 那我加下. 然后发个版. 估计这两天就能好. 好了就告诉你
from spring-boot-protocol.
我复现下, 还没有到过有DefaultFullHttpRequest的情况, 因为我把HttpObjectAggregator去掉了, 应该是没有Full请求的情况了.
from spring-boot-protocol.
提交解决了. 不过我没有复现出来啊, 你是如何发现的.
from spring-boot-protocol.
FullHttpRequest只有 HttpObjectAggregator这个类, 和http请求行解析失败时, 会收到.
但HttpObjectAggregator这个类的聚合不支持long类型, 所以去掉了.
不过为了代码健壮, 刚才也都加上了. 现在2.0.17这个版本还是没问题的.
from spring-boot-protocol.
2.0.17不支持apache common-fileupload了么。
public ResponseEntity<String> upload(HttpServletRequest request, HttpServletResponse response)
throws IOException, FileUploadException {
boolean isMultipart = ServletFileUpload.isMultipartContent(request);
if (isMultipart) {
ServletFileUpload upload = new ServletFileUpload();
Map<String, String> params = new HashMap<>();
InputStream is = null;
FileItemIterator iter = upload.getItemIterator(request);
while (iter.hasNext()) {
FileItemStream item = iter.next();
if (!item.isFormField()) {
is = item.openStream();
try {
.....
} catch (Exception e) {
e.printStackTrace();
} finally {
if (null != is) {
is.close();
}
}
} else {
String fieldName = item.getFieldName();
String value = Streams.asString(item.openStream());
params.put(fieldName, value);
}
}
}
return new ResponseEntity<String>("success", HttpStatus.OK);
}
from spring-boot-protocol.
应该是不影响的啊, 我试试咋回事
from spring-boot-protocol.
tomcat也不支持, 这里实现的逻辑和tomcat是一样的. 你可以这样保存文件
try {
Part part = request.getPart("myFile");
InputStream inputStream = part.getInputStream();
IOUtil.writeFile(inputStream,"D://test//upload","myfile.txt",false);
} catch (Exception e) {
e.printStackTrace();
}
from spring-boot-protocol.
解析的逻辑不需要你主动用common-fileupload写, servlet已经实现了.
from spring-boot-protocol.
tomcat 是可以的,另外2.0.15这个用法也是可以的,2.0.17不行。
from spring-boot-protocol.
好的
from spring-boot-protocol.
这次提交解决了这个问题, 已经发版在2.0.18, 过两天就能在maven**仓库拉包了.
from spring-boot-protocol.
多多提意见啊, 感谢感谢
from spring-boot-protocol.
Related Issues (16)
- spring-netty-example 请求出现异常 HOT 11
- FileUpload OutOfDirectMemoryError HOT 46
- split to core module plus protocol modules HOT 51
- 这种宝藏项目, 怎么才73star, 啊哈哈哈 HOT 1
- superfluous code HOT 1
- 有关206状态码, PARTIAL_CONTENT的行为 HOT 2
- http服务返回null 或者 http对象,如下: HOT 20
- 当websocket与spring整合, 不能摆脱对tomcat的依赖吗 HOT 2
- 强啊!!!能不能为 Solon 框架适配一个啊:) HOT 2
- 关于线程池,大佬求解答。。 HOT 3
- websocket无法使用 HOT 2
- servlet mapping HOT 4
- 导入了过期的包 HOT 3
- Cookie name \"{0}\" is a reserved token HOT 3
- Size of HttpObjectAggregator maxContentLength is 0, response 413 for all http requests HOT 8
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from spring-boot-protocol.