|
|
|
Using JSP 1.2 (via Glassfish Sun Java System Application Server 9.1 (build b58c-fcs)), the following JSF is not flagged with any error by IDEA:
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %> <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %> <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> <jsp:useBean id="simple" class="genomix.play.Simple"/> <f:view> <h:panelGrid > <h:outputText value="#{simple.address}"/> <h:outputText value="${simple.address}"/> <h3>${simple.address}</h3> </h:panelGrid> </f:view> When it is run the following exception is reported: org.apache.jasper.JasperException: /user/label.jsp(8,8) PWC6313: According to the TLD, the attribute value is a deferred-value or deferred-method, but the specified value contains a $-expression. The TLD version 1.2 states that the value attr of outputText must be deferred value expression, so IDEA should flag <h:outputText value="${simple.address}"/> as a syntax error even for JSP 1.2 Sorry – just a typo – where I wrote JSP I really meant JSF. The TLD referred to is the version 1.2 http://java.sun.com/jsf/html
In a similar vein, in JSF 1.2 the use of deferred evaluation mode for the "id" attribute below should be flagged as an error:
<h:inputText id="#{wrong}" value=.../> <h:inputText id="${okayButStrange}" value=.../> In the fragment below using an immediate evaluation on "items", and then trying to use the "var" in deferred mode is wrong, and it would be nice if IDEA could flag this issue. Basically it appears that with the JSTL iterator either deferred or immediate on the attributes "items" and "var" is okay, but not a mixture: <ol> <c:forEach items="${simple.states}" var="state"> <li><h:inputText value="#{state}"/></li> </c:forEach> </ol> AFAIK only JSF RI taglig descriptor (tld) has information about the validation you are asking for and this seriously complicates the problem
|
|||||||||||||||||||||||||||||||||||||||||||||||
So please let this inspection fire only for JSF 1.1 (or more likely it is depending on the JSP version).