Package com.jalios.jcms.tools
Class JspChecker
- java.lang.Object
-
- com.jalios.jcms.tools.AbstractChecker
-
- com.jalios.jcms.tools.JspChecker
-
public class JspChecker extends AbstractChecker
Check JSP/JSPF for bad coding practices.Eg. nested foreach, quotes in quote, A name, System.out, getParameter, IMG HTML 5 conformance
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
IGNORE_CHECK_ANAME
static java.lang.String
IGNORE_CHECK_GETPARAMETER
static java.lang.String
IGNORE_CHECK_I18N
Prefix property to allow files or dirs to be excluded from test checkI18N.static java.lang.String
IGNORE_CHECK_ICONSRC
static java.lang.String
IGNORE_CHECK_IMAGE
static java.lang.String
IGNORE_CHECK_JAVABEAN
static java.lang.String
IGNORE_CHECK_LEGACYINCLUDES
static java.lang.String
IGNORE_CHECK_MODALPICTURE
static java.lang.String
IGNORE_CHECK_NESTED_FOREACH
static java.lang.String
IGNORE_CHECK_PROCESSACTION
static java.lang.String
IGNORE_CHECK_QUOTES
static java.lang.String
IGNORE_CHECK_SYSOUT
static java.lang.String
IGNORE_ENCODE_HTML_ATTRIBUTES
static java.lang.String
VERIFIED_FOR_SECURITY
If a JSP line contains this constant, it will be ignored by JspChecker.checkGetParameter()-
Fields inherited from class com.jalios.jcms.tools.AbstractChecker
CHANNEL, PROP_SUFFIX_FILE_FILTER
-
-
Constructor Summary
Constructors Constructor Description JspChecker()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static CheckResult
checkAll(java.io.File webappDir)
static void
checkAName(CheckResult result, CheckedFile file, CheckerContext checkerContext)
static void
checkEncodeForHTMLAttribute(CheckResult result, CheckedFile file, CheckerContext checkerContext)
static void
checkGetParameter(CheckResult result, CheckedFile file, CheckerContext checkerContext)
static void
checkI18N(CheckResult result, CheckedFile file, CheckerContext checkerContext)
Checks that JSP/JSPF do not contains invalid I18N properties inside glp("...")static void
checkIconSrc(CheckResult result, CheckedFile file, CheckerContext checkerContext)
Checks that a <jalios:icon> src attribute is valid.static void
checkImage(CheckResult result, CheckedFile file, CheckerContext checkerContext)
static void
checkJavaBean(CheckResult result, CheckedFile file, CheckerContext checkerContext)
static void
checkModalPicture(CheckResult result, CheckedFile file, CheckerContext checkerContext)
Checks that a <jalios:modal> picture attribute is valid.static void
checkNestedForeach(CheckResult result, CheckedFile file, CheckerContext checkerContext)
static void
checkProcessAction(CheckResult result, CheckedFile file, CheckerContext checkerContext)
static void
checkQuoteInQuote(CheckResult result, CheckedFile file, CheckerContext checkerContext)
static void
checkSystemOut(CheckResult result, CheckedFile file, CheckerContext checkerContext)
static void
main(java.lang.String[] args)
-
Methods inherited from class com.jalios.jcms.tools.AbstractChecker
getCheckedFile, getFileList, getFileList, loadLanguageProperties, loadProperties, loadProperties, saveError
-
-
-
-
Field Detail
-
IGNORE_CHECK_I18N
public static final java.lang.String IGNORE_CHECK_I18N
Prefix property to allow files or dirs to be excluded from test checkI18N.Ex:
com.jalios.jcms.tools.JspChecker.checkI18N.ignored.{custom-suffix}: plugins/ExcludedPlugin/
com.jalios.jcms.tools.JspChecker.checkI18N.ignored.{custom-suffix}: plugins/ExcludedPlugin/excludedFile1.jsp, plugins/ExcludedPlugin/excludedFile2.jsp
- See Also:
- Constant Field Values
-
IGNORE_CHECK_NESTED_FOREACH
public static final java.lang.String IGNORE_CHECK_NESTED_FOREACH
- See Also:
- Constant Field Values
-
IGNORE_ENCODE_HTML_ATTRIBUTES
public static final java.lang.String IGNORE_ENCODE_HTML_ATTRIBUTES
- See Also:
- Constant Field Values
-
IGNORE_CHECK_QUOTES
public static final java.lang.String IGNORE_CHECK_QUOTES
- See Also:
- Constant Field Values
-
IGNORE_CHECK_ANAME
public static final java.lang.String IGNORE_CHECK_ANAME
- See Also:
- Constant Field Values
-
IGNORE_CHECK_SYSOUT
public static final java.lang.String IGNORE_CHECK_SYSOUT
- See Also:
- Constant Field Values
-
IGNORE_CHECK_GETPARAMETER
public static final java.lang.String IGNORE_CHECK_GETPARAMETER
- See Also:
- Constant Field Values
-
IGNORE_CHECK_IMAGE
public static final java.lang.String IGNORE_CHECK_IMAGE
- See Also:
- Constant Field Values
-
IGNORE_CHECK_MODALPICTURE
public static final java.lang.String IGNORE_CHECK_MODALPICTURE
- See Also:
- Constant Field Values
-
IGNORE_CHECK_ICONSRC
public static final java.lang.String IGNORE_CHECK_ICONSRC
- See Also:
- Constant Field Values
-
IGNORE_CHECK_JAVABEAN
public static final java.lang.String IGNORE_CHECK_JAVABEAN
- See Also:
- Constant Field Values
-
IGNORE_CHECK_LEGACYINCLUDES
public static final java.lang.String IGNORE_CHECK_LEGACYINCLUDES
- See Also:
- Constant Field Values
-
IGNORE_CHECK_PROCESSACTION
public static final java.lang.String IGNORE_CHECK_PROCESSACTION
- See Also:
- Constant Field Values
-
VERIFIED_FOR_SECURITY
public static final java.lang.String VERIFIED_FOR_SECURITY
If a JSP line contains this constant, it will be ignored by JspChecker.checkGetParameter()- See Also:
- Constant Field Values
-
-
Method Detail
-
main
public static void main(java.lang.String[] args) throws java.io.IOException
- Throws:
java.io.IOException
-
checkAll
public static CheckResult checkAll(java.io.File webappDir) throws java.io.IOException
- Throws:
java.io.IOException
-
checkNestedForeach
public static void checkNestedForeach(CheckResult result, CheckedFile file, CheckerContext checkerContext)
-
checkQuoteInQuote
public static void checkQuoteInQuote(CheckResult result, CheckedFile file, CheckerContext checkerContext)
-
checkEncodeForHTMLAttribute
public static void checkEncodeForHTMLAttribute(CheckResult result, CheckedFile file, CheckerContext checkerContext)
-
checkAName
public static void checkAName(CheckResult result, CheckedFile file, CheckerContext checkerContext)
-
checkSystemOut
public static void checkSystemOut(CheckResult result, CheckedFile file, CheckerContext checkerContext)
-
checkGetParameter
public static void checkGetParameter(CheckResult result, CheckedFile file, CheckerContext checkerContext) throws java.io.IOException
- Throws:
java.io.IOException
-
checkProcessAction
public static void checkProcessAction(CheckResult result, CheckedFile file, CheckerContext checkerContext) throws java.io.IOException
- Throws:
java.io.IOException
-
checkImage
public static void checkImage(CheckResult result, CheckedFile file, CheckerContext checkerContext) throws java.io.IOException
- Throws:
java.io.IOException
-
checkI18N
public static void checkI18N(CheckResult result, CheckedFile file, CheckerContext checkerContext) throws java.io.IOException
Checks that JSP/JSPF do not contains invalid I18N properties inside glp("...")- Throws:
java.io.IOException
-
checkModalPicture
public static void checkModalPicture(CheckResult result, CheckedFile file, CheckerContext checkerContext) throws java.io.IOException
Checks that a <jalios:modal> picture attribute is valid.- Parameters:
result
- theCheckResult
to updatefile
- the checked filecheckerContext
- theCheckerContext
- Throws:
java.io.IOException
- Since:
- jcms-9.0.0
-
checkIconSrc
public static void checkIconSrc(CheckResult result, CheckedFile file, CheckerContext checkerContext) throws java.io.IOException
Checks that a <jalios:icon> src attribute is valid.- Parameters:
result
- theCheckResult
to updatefile
- the checked filecheckerContext
- theCheckerContext
- Throws:
java.io.IOException
- Since:
- jcms-9.0.0
-
checkJavaBean
public static void checkJavaBean(CheckResult result, CheckedFile file, CheckerContext checkerContext) throws java.io.IOException
- Throws:
java.io.IOException
-
-