Avoid nesting single or double quotes in JSP tags

This rule flags JSP tags where a single quotes are nested within single quotes or double quotes are nested within double quotes.

Example 1:
<c:if test="<%=(link.indexOf(':') == -1)%>" >

In this example, the test attribute contains the character sequence ':' which is nested in outer single quotes '<%=(link.indexOf(':') == -1)%>' . This rule would flag this example.

The automated fix will escape the nested quotes. In the example, the quotes surrounding the ':' are escaped.

Example:
<c:if test="<%=(link.indexOf(\':\') == -1)%>" >

Having nested quotes in the JSP tag can result in an error message similar to the following example:

Error Message:JSPG0048E: Page failed to validate using taglib validator for ... : org.xml.sax.SAXParseException: Attribute name "jsp:id" associated with an element type "c:if" must be followed by the " = " character.
Root Cause:com.ibm.ws.jsp.translator.JspTranslationException: JSPG0048E: Page failed to validate using taglib validator for...

For additional information see: