DeejUK
DeejUK

Reputation: 13521

Eclipse JSTL Core Autocomplete

Eclipse's auto-complete for JSP tags works with Spring Security tags, but not JSTL core.

I've got the following declarations at the top of the JSP file:

<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags" %>

I'm depending on JSTL:

    <dependency>
        <groupId>javax.servlet</groupId>
        <artifactId>jstl</artifactId>
        <version>1.2</version>
    </dependency>

...But curiously, JSTL Core never auto-suggests.

Upvotes: 8

Views: 6199

Answers (2)

gamerson
gamerson

Reputation: 5320

The problem is that the jstl-api.jar that likely comes with the javax.servlet>jstl depencency does not contain the TLD files in the META-INF. What you need is the jstl-impl.jar file to be available somewhere on the project classpath (Maven dependencies or just included directly) because in the jstl-impl.jar file you can see it has this file: META-INF/c.tld

If the Eclipse JSP editor can read the jstl-impl.jar from your project classpath, then it can read in the tag info and give you auto-complete.

Screenshot of jstl completion in Eclipse JSP editor

Upvotes: 15

Arun Ganesan
Arun Ganesan

Reputation: 418

If you are using Jboss or other servers try jstl-api.jar. Add it to the eclipse classpath and it should work like charm.

Upvotes: 0

Related Questions