我正在尝试使用 springboot 制作一个简单的上传应用程序,它运行良好,直到我尝试上传 10Mb 以上的文件,我在屏幕上收到此消息:
There was an unexpected error (type=Internal Server Error, status=500).
Could not parse multipart servlet request; nested exception is java.lang.IllegalStateException: org.apache.tomcat.util.http.fileupload.FileUploadBase$SizeLimitExceededException: the request was rejected because its size (14326061) exceeds the configured maximum (10485760)
Run Code Online (Sandbox Code Playgroud)
我做了一些研究,直到现在还没有任何效果。我将在我迄今为止尝试过的事情下面离开这里。
将此代码(以各种方式)放在我的“application.yml”中
multipart:
maxFileSize: 51200KB
maxRequestFile: 51200KB
Run Code Online (Sandbox Code Playgroud)
我也在我的主要课程中尝试过这个:
@Bean
public TomcatEmbeddedServletContainerFactory containerFactory() {
TomcatEmbeddedServletContainerFactory factory = new TomcatEmbeddedServletContainerFactory();
factory.addConnectorCustomizers(new TomcatConnectorCustomizer() {
@Override
public void customize(Connector connector) {
((AbstractHttp11Protocol<?>) connector.getProtocolHandler()).setMaxSwallowSize(-1);
}
});
return factory;
}
Run Code Online (Sandbox Code Playgroud)
还有一些奇怪的事情。如果我输入我的 tomcat web.xml,multipart-config 是:
<multipart-config>
<!-- 50MB max …Run Code Online (Sandbox Code Playgroud) 我这里有问题.我有2个表,它们通过列"id.x"链接.一个表具有给定月份的周数,例如,对于1月份,表格每月每周有5行.另一张表代表一个员工在一周内的努力.
我想加入这两个表,但我想以某种方式向我展示一个员工在一周内的努力,所以在这种情况下,每个员工有5个注册管理机构,即使他在某个星期没有注册工作在这种情况下,我们将努力设置为null.
我会告诉你我正在寻找什么,如果可能的话.
Table 1:
id week month year id.x
1 1 1 2019 7819
2 2 1 2019 7819
3 3 1 2019 7819
4 4 1 2019 7819
5 5 1 2019 7819
Table 2:
employee_id effort id.x week
63 100 7819 3
Run Code Online (Sandbox Code Playgroud)
结果我想:
employee week effort id.x
63 1 null 7819
63 2 null 7819
63 3 100 7819
63 4 null 7819
63 5 null 7819
Run Code Online (Sandbox Code Playgroud)
有可能达到这个结果吗?
我目前正在尝试此查询:
select t2.employee, t1.week from
table_2 t2
cross join …Run Code Online (Sandbox Code Playgroud)