Reputation: 6207
Here is my situation: I'm working with an application that makes heavy use of JSP includes <%include ... %> and also loads tons of components dynamically using AJAX. All these get loaded into one main template page depending on what the user selects, etc.
My issue is with editing/maintaining these small page fragments that get included and loaded through AJAX. Since they are fragments, their code does not include a and doesn't include things like JQuery, which are added by the main template page.
Of course when they are loaded in the browser they work since the fragments are loaded through AJAX and added to the DOM.
The issue is: since these are just fragments, when I'm maintaining these pages I get a lot of errors and warnings on missing CSS classes and Javascript variables, etc. Besides, I can't use any WYSIWYG editors for the fragments due to the missing imports.
How can I tell Eclipse to assume certain imports (e.g. JQuery or CSS sheets)for these fragment files? Since using JSP templates is such a common design pattern I can't believe I'm the only person needing this.
Upvotes: 4
Views: 16696
Reputation: 3797
You can go to the
Eclipse - > Preferences - > JavaScript - > Include Path -> User Libraries
and add a new JavaSCript library.
You can give your project JS folder .
After that you can go to your project build path and include that library in build path.
or you can add it directly to your project from here,
Upvotes: 3