在预期的路径(eclipse jsp)中找不到片段 [英] fragment was not found at expected path (eclipse jsp)

查看:1283
本文介绍了在预期的路径(eclipse jsp)中找不到片段的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



布局



+ src

+++ META-INF

---- my.tld

++++++++ +++标签

--------------- include.jsp



我继续获取片段/META-INF/tags/include.jsp在预期路径中找不到/Project/META-INF/tags/taginclude.jsp



如何我修改eclipse正在寻找的路径?我需要告诉它在查找中包含src

解决方案

Josh,如果你正在使用.jsp和。 tld文件,那么你真的不应该这样做作为一个Java项目,而是在Eclipse中的动态Web项目。不过,我会尝试回答您的问题。



根据您的文件系统图,您的文件布局不正确。如果您要创建一个Web应用程序(.war文件),那么您需要一个WEB-INF目录。在WEB-INF目录下,您将需要一个web.xml文件(web.xml文件的google,以查看需要的内容),标签目录以及类和lib目录。



编译的类文件必须在WEB-INF / classes目录中。
您依赖的Jar文件必须位于WEB-INF / lib目录中。
Tablib必须进入WEB-INF / tags目录。
最后,您的.jsp文件必须位于src目录(WEB-INF的父目录)中。



所以,你的布局应该如下所示: / p>

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

希望这有帮助。



-Bryan


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

解决方案

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

这篇关于在预期的路径(eclipse jsp)中找不到片段的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆