1

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

Mercer
  • 9,736
  • 30
  • 105
  • 170

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,834
  • 5
  • 44
  • 65