joshjdevl
joshjdevl

Reputation: 7222

fragment was not found at expected path (eclipse jsp)

In eclipse, I have a javaproject (not a web project), though it does provide reusable tag files.

layout

+src
+++META-INF
----my.tld
+++++++++++tags
---------------include.jsp

I keep on getting Fragment "/META-INF/tags/include.jsp" was not be found at expected path /Project/META-INF/tags/taginclude.jsp

How can I modify the path eclipse is looking for? I need to tell it to include "src" in the lookup

Upvotes: 3

Views: 16235

Answers (3)

user3940641
user3940641

Reputation:

Maybe the path of the jsp page is incorrect!You can check it using ctrl+left click,if can't open the jsp file,I suggest you check the path.

Upvotes: 0

nitind
nitind

Reputation: 20013

I'm afraid I don't understand the ascii representation in the original post, but the validator can make use of any project with a ModuleCore Nature and its .settings/org.eclipse.wst.common.component file to find out what "/" means. Creating a Dynamic Web Project and inspecting that file and .project might help you piece together the right contents to make this work in your Java project.

Upvotes: 1

Bryan
Bryan

Reputation:

Josh, if you're working with .jsp and .tld files, then you really shouldn't be doing this as a "Java Project", but instead a "Dynamic Web Project" in Eclipse. Nonetheless, I'll try to answer your question.

Based on the diagram of your file system, your files are laid out incorrectly. If you're trying to create a web app (a .war file), then you need a WEB-INF directory. Under the WEB-INF directory you'll need a web.xml file (google for web.xml to see what needs to be in there), a tags directory, and a classes and lib directory.

Compiled class files must go in the WEB-INF/classes directory. Jar files that you depend on must go in the WEB-INF/lib directory. Tablibs must go in the WEB-INF/tags directory. Finally, your .jsp files must go in src directory (the parent dir of WEB-INF).

So, your layout should look like this:

myproject/
`-- src
    |-- WEB-INF
    |   |-- classes
    |   |   `-- MyClass.class
    |   |-- lib
    |   |   `-- my.jar
    |   |-- tags
    |   |   `-- my.tld
    |   `-- web.xml
    `-- include.jsp

Hope this helps.

-Bryan

Upvotes: 4

Related Questions