facebook

Problem using a non-webapp structured repository

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

    swilliams
    Member

    Hi:

    I have a question about an issue that occurs with a web application using a repository that is not configured in the standard web application file structure. The project is using a CVS repository that is not configured in the standard webapp layout, and uses Maven to build a war for deployment. The problem I am having is that MyEclipse cant see the TLDs defined in the web.xml file, which is not surprising since the non-standard file layout is most likely causing it to look in the wrong place. Here are the details:

    Taglib directive points to a URI defined in the web.xml file:

    
    <%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%>
    

    Taglib element from the web.xml file points to the .tld files under /WEB-INF/tlds directory:

    
      <taglib>
        <taglib-uri>/WEB-INF/struts-bean.tld</taglib-uri>
        <taglib-location>/WEB-INF/tlds/struts-bean.tld</taglib-location>
      </taglib>
    

    But because of the structure imposed by the repository, the actually filesystem layout looks like this:

    
    /project_root
        /src
        /target
        /webapp
             /WEB-INF
                  /tlds
                        /struts-bean.tld
                        /other.tld
    

    It certainly appears that the mismatch b/w the existing (repo) and expected (webapp) file structures is causing MyEclipse to not find the tld’s and create a lot of errors when the JSP editor is open. Is there a way to correct this by configuring MyEclipse to work with the existing structure? What I read about “add WebProject Capabilities” led me to believe that it would actually restructure the application into the standard web-app layout, which is not what I want to do.

    Is there a way to fix this problem besides pointing the web.xml’s <taglib-location> element to an external definition of the tld? I think that would solve the immediate problem, but I’m sure that the file structure mismatch issue is going to crop up again elsewhere.

    Thanks in advance for any suggestions.

    #226721 Reply

    swilliams
    Member

    Problem solved – please disregard this post.

    #226722 Reply

    Riyad Kalla
    Member

    swilliams,
    When you add web capabilities all it does it ask you some quesitons (web root dir, in your case “webapp”, web context like /myapp, etc.) then it saves those settings so it knows how to interpret your application. This will be the only way to get MyEclipse’s editors happy with your setuop (Which is perfectly fine, but without web capabilities, it has no idea what it’s looking at).

    The only files that get added when you add web capabilities are: .mymetadata file in the root of your project AND your output dir will by default be set to webapp/WEB-INF/classes, so if you have resources in your classes dir that ARE NOT in your /src dir, when the project rebuilds it will clean them out (erase them) so make sure that any property files, xml files, etc. that are in our output dir, also exist in your source dir (as they should).

    Then it’s just a hop-skip and a jump away from working 😉

    #226726 Reply

    swilliams
    Member

    Thanks for the information, rkalla.

Viewing 4 posts - 1 through 4 (of 4 total)
Reply To: Problem using a non-webapp structured repository

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