1

hello what is the difference between <%+i%> and ${i}

Mercer
  • 9,488
  • 27
  • 98
  • 165

1 Answers1

3

<% %> is a jsp scriptlet - you can write java code there
<%= %> is a jsp expression - you can put there java statements without a semicolon they will be printed on the page.
${} is an EL expression - you can use these instead of jsp expressions (actualy using EL is recommended)
As a small example: <%=request.getAttribute("query") %> is the same like ${query}

kukudas
  • 4,726
  • 5
  • 43
  • 63