facebook

Invalid location of tag – doesn’t know context ?

  1. MyEclipse IDE
  2.  > 
  3. General Development
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #217120 Reply

    nupstone
    Member

    Hi,

    I saw the stuff about having validation work when including taglibs from elsewhere, but what about having the included file get correctly validated:

    For example, the following code from the tiles-documentation example that comes with Tomcat gives me Invalid location of tag (table):

    
    <%@ page import="org.apache.struts.tiles.ComponentContext"%>
    <%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles" %>
    
    <%-- Layout component 
      Render a list in severals columns
      parameters : numCols, list0, list1, list2, list3, ... 
    --%>
    
    <tiles:useAttribute id="numColsStr" name="numCols" classname="java.lang.String" />
    
    
    <table>
    <tr>
    <%
    int numCols = Integer.parseInt(numColsStr);
    ComponentContext context = ComponentContext.getContext( request );
    for( int i=0; i<numCols; i++ )
      {
      java.util.List list=(java.util.List)context.getAttribute( "list" + i );
      pageContext.setAttribute("list", list );
      if(list==null)
        System.out.println( "list is null for " + i  );
    %>
    <td valign="top">
      <tiles:insert page="/layout/vboxLayout.jsp" flush="true" >
        <tiles:put name="componentsList" beanName="list" beanScope="page" />
      </tiles:insert>
    </td>
    <%
      } // end loop
    %>
    </tr>
    </table>
    

    Is there a way for me to tell the JSP validator and code completion what my context is when I’m editing a fragment file ?

    Thanks,

    Neale

    PS. Did search for “Invalid location of tag” in forums and didn’t have any luck.

    #217208 Reply

    Riyad Kalla
    Member

    Neale,
    The context is always within your WebRoot… so / is actually your WebRoot… /WEB-INF is your WEB-INF dir under your webroot, your path here “/layout/vboxLayout.jsp” suggest you have the following setup:

    
    + WebRoot
      + layout
        + vboxLayout.jsp
    
Viewing 2 posts - 1 through 2 (of 2 total)
Reply To: Invalid location of tag – doesn’t know context ?

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