Search code examples
javajspservletsscriptlet

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


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

What's the difference between both cases ?

Thanks


Solution

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

    Here are the links to the jsp documentation: