I more or less know the difference between <%! and <%, but I can\'t seem to find the difference between <%= and <%. I\'m trying to avoid a null value error by intr
<% %> ------> This tag we call as scriptlet tag in JSP. Actually, whatever you do in a .jsp file it will convert back to Servlet internally, Because in Servers only thing which runs internally are Servlets,You can write all your Html code inside the out.println() inside the Servlets, But as developers, it's easy for us to have separate sections for back-end and front-end , That's the main reason why we need JSP files. So If you need to do something relevant to service() method in Servlets, do that inside <% %> this tag. If you need to just need to get an output of something use <%= %>----> expression tag. If you need to see how JSP files internally converting back to servlets please use netbeans IDE(It has a separate tool to view it.).
Writing a code inside a servlet's service() method == <% %> [coding inside scriptlet tag]
Writing a code outside the service method but inside the Servlet class == <%= %>[coding inside expression tag ]