Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 899
EngineerBetter_DJ Avatar asked Jun 10 '12 14:06

EngineerBetter_DJ


1 Answers

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

like image 98
gamerson Avatar answered Oct 25 '22 11:10

gamerson