- This topic has 6 replies, 2 voices, and was last updated 20 years, 9 months ago by
Riyad Kalla.
-
AuthorPosts
-
tedymc01MemberHi,
When I edit a JSP file, I can use the code completion in HTML and JSP tags, but I can´t use it in struts taglibs. Why?
Where do I configure the tld locations in my project? Is there any special location for them? And the location of web.xml? May I have to put something in the project classpath?
Today, my project development strutucture is (simplified):
project |- src |- www |- jsp |- images |- resources // web.xml, *.xml |- tld
Thanks in advance,
Tedy.
Riyad KallaMemberTedy,
Your current project structure, while fine, won’t work so well with MyEclipse. We currently support an “exploded WAR format” (http://www.myeclipseide.com/FAQ+index-myfaq-yes-id_cat-30.html#111). The directory structure you have now is effectively a split of the WAR file.. you have broken out the WEB-INF dir into the “resources” dir, and left the “WebRoot” dir as “www”.If you can rename “resources” to “WEB-INF” and move it back into your www and set “www” as your webroot, then you should be fine. Then the autocomplete for taglibs should work fine as MyEclipse will then be able to resolve the classes and completions for the tags.
Where do I configure the tld locations in my project?
This is done via <taglib> tags in your web.xml file. Location of tags in the web.xml file is important, so you can’t just stick it anywhere.
And the location of web.xml?
This must be directly under the WEB-INF dir which is under your webroot directory. This is part of the spec, not something we made up 😉
May I have to put something in the project classpath?
Yes, you must have the class that implements the taglib in your Java Build Path. If this is the struts tags, then just have struts.jar will do it. If they are you own custom tags or some other custom tags, make sure to include the JAR or class file in your build path.
I suggest that you have a look at the J2EE tutorial starting with this chapter: http://java.sun.com/j2ee/1.4/docs/tutorial/doc/WebApp.html#wp76431
This explains how web apps are packaged, where stuff needs to go, how you link to it, etc… its very handy.
tedymc01MemberThanks Riyad! But I have 1 more question:
In which option do I set www as my WebRoot directory?🙂
Tedy.
tedymc01MemberThanks Riyad! But I have 1 more question:
In which option do I set www as my WebRoot directory? My project is set as “Java Application”.🙂
Tedy.
Riyad KallaMemberAhh that is a good question 🙂
Right click on your project root, go down to Properties, then flip over to the “MyEclipse-Web” settings. Here you set your Web root, and your Web root context. The web root is the root in your project, “www” in this case, and the Web root context (or web context root, I forget) is the root folder for your web application, this is usually your application name, something like “/onlineStore” where your project would be an onlineStore web app or something along those lines.
tedymc01MemberOK Riyad! I created a Java Application project, and this kind of project doesn´t have that property (MyEclipse-Web). But I created a new J2EE project (Web Module Project), and now I found that property!
Really thanks,
Tedy.
PS: that questions I asked you in my first post addressed all the same problem (I was just making some kind of brainstorming hehehe 🙂 )… I thought that files (tlds, web.xml) had special locations in my project structure, and I´d set that locations in order to jsp completion work… Even tough, I understood your response and now it´s all working!
Riyad KallaMemberHey I’m glad to hear its all working now Tedy. Come back if you have any more questions.
-
AuthorPosts