JSP - what's the difference between “<% … %>” VS “<%= … %>”

JAN picture JAN · Jul 14, 2012 · Viewed 7.1k times · Source

While working with JSP files and servlets , I came across <% … %> and <%= … %> .

What's the difference between both cases ?

Thanks

Answer

Cristian picture Cristian · Jul 14, 2012

<%= … %> will echo out a variable, where as <% … %> denotes a script or some code that is executed.

Here are the links to the jsp documentation: