I am trying to display list of entities in a .jsp file, but I this error:
Unable to compile class for JSP:
An error occurred at line: 28 in the jsp file: /gues
You shouldn't be using scriptlets (those oldschool <% %>
things with Java code) at all when using servlets and EL. Use taglibs like JSTL instead. It offers the
For example,
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
...
Drug Names
Target Names
${fn:escapeXml(drugtarget.drug)}
${fn:escapeXml(drugtarget.target)}
(note that I also fixed the rendering of table rows by putting the Much simpler, isn't it? You can by the way also just use If you can, I suggest to add the following to your webapp's inside the loop)
instead of those functions.web.xml
in order to disable scriptlets altogether so that you will be forced to do things the right way.See also: