About writing [if] and [else] statements in JSP, Syntax error on token “else”, delete this token

A article is reproduced here: https://blog.csdn.net/sinat_37062120/article/details/79208949
Insert Java code into the JSP

<%if (***)%>
<%=***%>
<%else %>
<%=***%>

Error in the “else” in the third line
Syntax error on token “else”, delete this token

else must be followed by if. This error indicates that if
solution is not found:
add parentheses. Note that the “} “of if must be written inside the” else”

<%if (***) {%>
<%=***%>
<%} else {%>
<%=***%>
<%}%>

 

Read More: