facebook

Taglib validation & code assist in included file

  1. MyEclipse IDE
  2.  > 
  3. Java EE Development (EJB, JSP, Struts, XDoclet, etc.)
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #227409 Reply

    Xavier GORSE
    Member

    Hello

    In my web project i have some included jsp files which use taglibs

    When i edit these files , the validation fails and code assist doesn’t work too.

    I think that’s because there are not taglibs declaration in these files.

    Is there a solution ?

    Thanks

    #227447 Reply

    Riyad Kalla
    Member

    Can you please post all the information we request in the [URL=http://www.myeclipseide.com/PNphpBB2+file-viewtopic-t-393.html]Posting Guidelines[/URL] thread at the top of this forum? That will give us some context so that we can determine if this is an installation issue, a configuration problem, or a bug. Thanks.

    Also I would like to see your <taglib> section from your web.xml file, and the code snippets of the JSP files that are giving you problems.

    #227481 Reply

    Xavier GORSE
    Member

    Sorry for the posting guidelines

    Windows XP SP2
    Eclispe ( Version: 3.0.2 – Build id: 200503110845)
    My eclipse ( Version: 3.8.4 – Build id: 200501171200-3.8.4)
    Fresh install of Eclispe and My eclipse
    j2sdk1.4.2_05 & Tomcat 5.0.28

    I have a main jsp include file with taglibs declaration (inc_java.jsp)

    <%@ page language="java" import="java.util.*" %>
    <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>

    For my index.jsp i have

    <%@include file="inc_java.jsp" %>
    blabla html & taglib code 
    <%@include file="inc_pb.jsp" %>

    In this index.jsp validation & code assist work well

    but when i edit inc_pb.jsp validation & code assist won’t work

    In my web.xml there’s no taglib section

    #227497 Reply

    Riyad Kalla
    Member

    What does inc_pb.jsp look like? You didn’t post it above (your setup looks good though).

    #227505 Reply

    Xavier GORSE
    Member

    It’s look like

    <c:if test="${true}">
    blabla
    </c:if> 

    But the problem is the same when i use a scriptlet in inc_pb.jsp which use some classes imported in inc_java.jsp.

    <%
    TreeMap T = new TreeMap();
    %>
    #227507 Reply

    Riyad Kalla
    Member

    Ahh, ok:

    1) When a java file only exists to be included in another file and cannot stand by itself as a valid JSP file, it is a JSP segment or fragment. It is suggested by spec to name those files “.jspf”.
    2) You won’t get validation or autocomplete in them, which is tradgic but shouldn’t effect you too much as includes don’t change terribly often.
    3) If you need validation/autocomplete for your includes, then you must treat them like real JSP pages, you will need into <%@include %> your inc_java.jsp page so your pb page can resolve the types and taglibs.

Viewing 6 posts - 1 through 6 (of 6 total)
Reply To: Taglib validation & code assist in included file

You must be logged in to post in the forum log in