Attempts to parse 'JspAttributeAndBody' production. Returns true if it matched, or false if not. Assumes EmptyBody is okay as well. JspAttributeAndBody ::= ( '>' # S? ( '<jsp:attribute' NamedAttributes )? '<jsp:body' ( JspBodyBody | <TRANSLATION_ERROR> ) S? ETag )
(Node parent, String tag, String bodyType)
| 947 | * <TRANSLATION_ERROR> ) S? ETag ) |
| 948 | */ |
| 949 | private boolean parseJspAttributeAndBody(Node parent, String tag, String bodyType) throws JasperException { |
| 950 | boolean result = false; |
| 951 | |
| 952 | if (reader.matchesOptionalSpacesFollowedBy("<jsp:attribute")) { |
| 953 | // It may be an EmptyBody, depending on whether there's a "<jsp:body" before the ETag |
| 954 | |
| 955 | // First, parse <jsp:attribute> elements: |
| 956 | parseNamedAttributes(parent); |
| 957 | |
| 958 | result = true; |
| 959 | } |
| 960 | |
| 961 | if (reader.matchesOptionalSpacesFollowedBy("<jsp:body")) { |
| 962 | // ActionBody |
| 963 | parseJspBody(parent, bodyType); |
| 964 | reader.skipSpaces(); |
| 965 | if (!reader.matchesETag(tag)) { |
| 966 | err.jspError(reader.mark(), "jsp.error.unterminated", "<" + tag); |
| 967 | } |
| 968 | |
| 969 | result = true; |
| 970 | } else if (result && !reader.matchesETag(tag)) { |
| 971 | // If we have <jsp:attribute> but something other than |
| 972 | // <jsp:body> or the end tag, translation error. |
| 973 | err.jspError(reader.mark(), "jsp.error.jspbody.required", "<" + tag); |
| 974 | } |
| 975 | |
| 976 | return result; |
| 977 | } |
| 978 | |
| 979 | /* |
| 980 | * StandardAction ::= 'include' StdActionContent | 'forward' StdActionContent | 'invoke' StdActionContent | 'doBody' |
no test coverage detected