I have a code like <div id="test<%=j%>" class="test" > and my editor shows problems with the matching divs. I suspect this is responsible for a lot of ghosts in my code where values are not populated in beans, etc. Is this a correct way of doing this? Any guidelines or best practices that I should follow?
</div>
I have a code like <div id=test<%=j%> class=test > </div> and my editor shows
Share
This code is syntactically correct. The problem is your editor, which doesn’t handle JSP scriptlet expressions.
But it’s using scriplet expressions, which should not be used anymore (for years). Use the JSP expression language, the JSTL, and other custom tag libraries.
Avoid any scriptlet in the JSPs. Java code should be is Java classes (servlets or actions of your preferred MVC framework).