public class FileDownload extends BaseServlet
isc.stripVersionPathSegments
attribute is enabled in server.properties, this servlet will also strip out SmartClient-version path segments when resolving URLs. Please contact Isomorphic (http://forums.smartclient.com) to learn more about the Network Performance package.
Modifier and Type | Field and Description |
---|---|
java.util.Map | charsets This is a comma separated expiration mapping of the form: mimeType:charset This allows you to specify a character encoding for a given mimeType. |
java.util.Map | expires This is a comma separated expiration mapping of the form: mimeType:seconds to expiry . |
int | stripPathComponents Instructs this servlet to remove the specified number of paths components from the URI before looking for the file on disk. |
handleError, handleError
public java.util.Map expires
mimeType:seconds to expiry
. This allows you to specify how long the browser is allowed to cache the file maching a given mime type from the time the file is originally served. For example, to set javascript files to expire in 1 hour and gif images to expire in 1 day: text/javascript:3600,image/gif:86400
The comparison is an exact match of the specified mimeType against what the container returns for the intercepted URL. So, for example, if you specified text/javascript:3600
here, but the container was configured to return application/x-javascript
for *.js (a common mimeType for javascript), then your expiry setting for *.js files would not apply.
public java.util.Map charsets
mimeType:charset
This allows you to specify a character encoding for a given mimeType. For example, to set javascript files to be served with the UTF-8 encoding, set this value to: text/javascript:UTF-8
For mimeTypes that do not have a charset specified, no charset setting is applied, so the container default is used.
The comparison is an exact match of the specified mimeType against what the container returns for the intercepted URL. So, for example, if you specified text/javascript:UTF-8
here, but the container was configured to return application/x-javascript
for *.js (a common mimeType for javascript), then your charset setting for *.js files would not apply.
public int stripPathComponents