Question

I am trying to restrict the size of an uploaded file, using gwtupload, to about 30 KB. So I have set the value of the parameter maxSize to 30360 in web.xml. 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:

<?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>
Was it helpful?

Solution

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.

Although the error message is not very friendly. Is there any way to personalise the error message?

Regards,

Glyn

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top