How can I avoid Java code in JSP files, using JSP 2?
Asked 07 September, 2021
Viewed 836 times
  • 64
Votes

I'm new to Java EE and I know that something like the following three lines

<%= x+1 %>
<%= request.getParameter("name") %>
<%! counter++; %>

is an old school way of coding and in JSP version 2 there exists a method to avoid Java code in JSP files. What are the alternative JSP 2 lines, and what is this technique called?

30 Answer