what is a proper way to use variables from scriptlets in jstl? I don\'t know what is wrong in my code:
<%
boolean a = true;
boolean b = false;
%>
<
Variables in scriptlets cannot be seen in JSTL because Expression Language, the stuff between ${}
used in JSTL, will look for attributes in page, request, session or application. You have to at least store the variable from scriptlet in one of these scopes, then use it.
This is an example:
<%
boolean a = true;
request.setAttribute("a", a);
%>
More info:
As a recommendation, stop using scriptlets. Move the business logic in your JSP to controller and the view logic into EL, JSTL and other tags like