Single Java instruction or variable in the HTML context
'<%=LanguageUtil.get(locale, "key-name")%>'Java code block
<%
String s = "";
%>Java code outside doGet() and doPost()
<%! code %>The exclamation mark makes all the difference. Since it's outside any method, such code typically includes things like variable declarations and complete method declarations. For example:
<%! public static MyType varbl;
public long countEm() {
long retval = 0L;
retval *= varbl.toLong();
return retval;
}
%>pageContext is an implicit object
Stupid comment -.-
<% } else { //elsecomment %>But IDE like eclipse doesn't recognize that as an error!
This code is valid!
"<%=LanguageUtil.get(pageContext, "key.value")%>";GENERATED JSP IS EXCEEDING THE 65535 BYTES LIMIT
You are a bad programmer!
Poor practice but it works.
<%@include file="db.jsp" %>