|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.isomorphic.servlet.BaseFilter | +--com.isomorphic.js.JSSyntaxScannerFilter
JSSyntaxScannerFilter
looks for Javascript syntax errors in code sent to the
browser. The purpose of this filter is to catch syntax errors that are poorly reported on by the
browsers - such as, for example, the trailing comma bug.
It's safe to register this filter in front of arbitrary files/servlets/filters. If the mime type
is other than one of those specified by the scannableMimeTypes configuration parameter (see
below), the stream is passed through without inspection. Further, if the mime type is deriveable
from the extension then bufferring is avoided for non-scannable mime types.
The filter scans javascript files in their entirety. For html files,
the filter looks for javascript code in <SCRIPT> tag and scans that code for any errors.
All errors are reported in the ISC server logs, complete with a source line number for the error.
Errors detected
Note that if the upstream content is served compressed it will be ignored by the scanner. Typical cases include: FileAssembler virtual urls with compress=true directives, compressed FileDownload content, or CompressionFilter if registered upstream from this filter.
Field Summary | |
boolean |
scanAssembledFiles
If you're using the Assembly module, this parameter controls whether or not assembled files are scanned by this filter. |
java.util.List |
scannableMimeTypes
Comma or separated list of scannable mimeTypes. |
boolean |
sendErrorsToBrowser
If set to true, then any syntax errors reported by this filter are sent to the browser in lieu of the content containing the errors, the errors are also still logged in the server logs. |
Field Detail |
public boolean scanAssembledFiles
This parameter defaults to false.
public java.util.List scannableMimeTypes
public boolean sendErrorsToBrowser
This parameter defaults to true.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |