${customer.name} IntelliJ Idea ...">

JSTL foreach and intellisense

With this code:

<c:forEach items="${customers}" var="customer">
    ${customer.name}
</c:forEach>

IntelliJ Idea can conclude that the type of the client variable in the ForEach loop belongs to the Client class (given that clients are something like List <Customer). If I reorganize the java client class and change getName to getFullName, it will change jstl to read $ {customer.fullName}.

I downloaded the standard.jar source and I don’t see how it can really be done. I know that you should be able to generate type information using a tei class, but the TEI class in Jakarta Taglibs does not. Does anyone know what I'm missing?

(I'm trying to make my own foreach, but I won’t do it if I can’t get the same level of support, but I just don’t see how to do it ..)

+3
source share
2 answers

I believe that intellij outputs things specifically because it knows about shared libraries in JSF / Facelets / JSP. I don’t think taglibs have anything to point this to the IDE.

I'm not sure if they offer any hooks so that your function supports your own tag extensions, but I doubt it.

+2
source

I think Idea has code written specifically for JSTL support, instead of doing it dynamically for any tag library based on tag and TLD.

, ""? Idea , - List<Customer> getCustomers(), Method , List Customer. , .

, Idea .

+2

Source: https://habr.com/ru/post/1716624/


All Articles