Java Reference
In-Depth Information
private int deleteIndex;
public int getDeleteIndex() {
return deleteIndex;
}
public void setDeleteIndex( int deleteIndex) {
this .deleteIndex = deleteIndex;
}
The Message Compose page now supports uploading attachments.
Before we move on to streaming the files back to the user when viewing
an email that has attachments, we need to talk about one more thing
regarding file uploads.
To avoid malicious users from causing harm to your web application
by uploading extremely large files, Stripes imposes a default maximum
size of 10MB. This is the total size of the request data, including all
uploaded files, request parameters, request headers—everything. 5 You
can change the maximum allowed size by adding a parameter to the
Stripes filter in web.xml :
<init-param>
<param-name> FileUpload.MaximumPostSize </param-name>
<param-value> 5M </param-value>
</init-param>
This would set the limit to 5MB. You can use K , M , or G (uppercase
or lowercase) as a suffix to indicate kilobytes, megabytes, or gigabytes.
Without a suffix, the value is assumed to be in bytes. If you use a suffix,
make sure not to put any spaces between the value and the suffix. Also
note that any extra characters after the suffix are ignored. This means
that you could, as a matter of preference, use 5MB instead of 5M .
Streaming Files
Now that the webmail supports uploading files as attachments, we
should also allow users to download attachments when they view a
message.
We'll start by displaying the attachments on the Message Details page.
This is fairly straightforward—we just need to loop through the attach-
ments and display each one with a link to an event handler on the
action bean.
5. This is another limitation of the HTTP specification. Before processing a request, the
only information that's available is the total size of the request data.
 
 
 
Search WWH ::




Custom Search