简体   繁体   English

Eclipse-gwtupload-maxSize

[英]Eclipse - gwtupload - maxSize

I am trying to restrict the size of an uploaded file, using gwtupload, to about 30 KB. 我正在尝试使用gwtupload将上传文件的大小限制为大约30 KB。 So I have set the value of the parameter maxSize to 30360 in web.xml. 因此,我在web.xml中将参数maxSize的值设置为30360。 However, the console logger still shows: 但是,控制台记录器仍显示:

0    [qtp349420578-27] INFO  gwtupload.server.UploadServlet  - UPLOAD-SERVLET init: maxSize=3145728, slowUploads=0, isAppEngine=false, corsRegex=^$

Any ideas on how I can override this? 关于如何可以覆盖此的任何想法?

Regards, 问候,

Glyn 格林

This is the whole web.xml: 这是整个web.xml:

<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE web-app
PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"http://java.sun.com/dtd/web-app_2_3.dtd">

<web-app>

<context-param>
    <!-- max size of the upload request -->
    <param-name>maxSize</param-name>
    <param-value>30360</param-value>
    <!-- param-value>3145728</param-value  -->

</context-param>

<context-param>
    <!-- Useful in development mode to slow down the uploads in fast networks.
     Put the number of milliseconds to sleep in each block received in the server.
     false or 0, means don't use slow uploads  -->
    <param-name>slowUploads</param-name>
    <param-value>0</param-value>
</context-param>

<servlet>
     <servlet-name>mySQLConnection</servlet-name>
     <servlet-class>org.AwardTracker.server.MySQLConnection</servlet-class>
</servlet>

<!-- servlet>
    <servlet-name>uploadServlet</servlet-name>
    <!- This is the default servlet, it puts files in session -
    <servlet-class>gwtupload.server.UploadServlet</servlet-class>
</servlet -->

<servlet>
    <servlet-name>uploadServlet</servlet-name>
    <servlet-class>org.AwardTracker.server.MyCustomisedUploadServlet</servlet-class>
</servlet>

<servlet-mapping> 
    <servlet-name>mySQLConnection</servlet-name> 
    <url-pattern>/org.AwardTracker.AwardTracker/MySQLConnection</url-pattern> 
</servlet-mapping>

<servlet-mapping>
    <servlet-name>uploadServlet</servlet-name>
    <url-pattern>*.gupld</url-pattern>
</servlet-mapping>

<!-- Default page to serve -->
<welcome-file-list>
    <welcome-file>AwardTracker.html</welcome-file>
</welcome-file-list>    

</web-app>

I recompiled and it now works. 我重新编译,现在可以了。 I had already done a "clean". 我已经做了一个“清洁”。 I do not know why I need to to recompile for a web.xml change. 我不知道为什么需要重新编译以更改web.xml。

Although the error message is not very friendly. 虽然错误消息不是很友好。 Is there any way to personalise the error message? 有什么方法可以个性化错误消息?

Regards, 问候,

Glyn 格林

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM