- This topic has 18 replies, 3 voices, and was last updated 19 years ago by Riyad Kalla.
-
AuthorPosts
-
thogauMemberHi,
I am new to myeclipseide and I’d like to know wether tag library completion is supported in that way :
1) in a jsp page /common/taglibs.jsp :
<%@ taglib uri=”http://struts.apache.org/tags-bean” prefix=”bean” %>
2) in some other jsp pages :
<%@ include file=”/common/taglibs.jsp”%>
<bean:write …..>Is it possible to have completion in the 2) provided the taglib declaration in 1) is correct and completion is working in 1) ?
I know that is now working in WTP so can I expect it to work with myeclipse?
Do I have to setup something?Thanks,
Thomas
Riyad KallaMemberThomas,
To answer all your questions “yes yes and yes”, all of this should work and to boot your values look fine for a Struts 1.2 project. To possibly see why this isn’t working please answer the following questions:1) Is your project a Web Project?
2) If you open your struts.jar file that is in your Build Path, and go into the META-INF dir and open the bean tld file, and look around the 4th or 5th line for a <uri> tag, what value is in there?
thogauMemberThanks for your quick answer.
I should have given more information to explain the problem :
1) my project in an appfuse (http://raibledesigns.com/wiki/Wiki.jsp?page=AppFuse) based project, it is not a real eclipse web project.
2) the value in the uri tag of struts jar is the same used in <%@ taglib uri=”http://struts.apache.org/tags-bean” prefix=”bean” %>
The point is that it is working fine in files which have the taglib declaration :
<%@ taglib uri=”http://struts.apache.org/tags-bean” prefix=”bean” %>
<bean:… completion worksBut it doesn’t in pages that include the file that contains declarations :
<%@ include file=”/common/taglibs.jsp”%> taglib is declared in this file
<bean:… completion does not workThis is supported in WTP but only works with latest milestone release, could you please confirm that it should work with 4.0.3GA_E3.1 ?
Thanks,
Thomas
Riyad KallaMember1) my project in an appfuse (http://raibledesigns.com/wiki/Wiki.jsp?page=AppFuse) based project, it is not a real eclipse web project.
This will be a problem, please search the forums for AppFuse. We had a gentleman in the forums that took about a week to convert AppFuse itself to a MyEclipse Web Project, I helped me a bit but it is a time intensive effort.
This is supported in WTP but only works with latest milestone release, could you please confirm that it should work with 4.0.3GA_E3.1 ?
If it were a web project it would work, if it is not a Web Project and instead is a Java Project, this is likely the problem.
thogauMemberStrange…
I moved to myeclipse couple of days ago with my current appfuse projet that I started with WTP and a bunch of plugins and for me, the move has been very smooth.
I don’t remember I had to change anything in my project because of myeclipse.
The only missing part compared to my former WTP setup is this taglib completion.I would expect that completion doesn’t work at all since it is not a web project but it *does* work as long as the tag is declared in the same page…
I’ll ask on appfuse mailing list and update this thread if I find out something interesting
Best,
Thomas
Riyad KallaMemberThomas,
Sorry my last post was a little dismissive, are you able to create a copy of the project and add web capabilities to that one and see if autocomplete begins working? I ask because we did *some* work to provide web support in java Projects, but it’s such a pain for us to try and maintain that with all the possible combinations that we really don’t focus on supporting that setup. So if you had added web caps and it was still acting wonky then we would definately have to look into that.
thogauMemberRKalla,
I think I didn’t manage to explain the problem correctly (damn english tongue!).
I am using eclipse/appfuse in almost all my web projects and the first thing I do once appfuse is checked out is to tweak my setup to have everything working.
Unfortunatly, I can’t tell from the top of my head which steps I perform since I fix the problems as they come.
Afterwords, I have everything I need working and code completion works for : java code, html, xdoclet and so on…Tag library completion is working when used in a classical way, I mean when the taglib declaration is within the edited jsp page.
To make the code cleaner and more maintanable, I have jsp page that contains all the tag library declarations that are commonly used in my project (struts, jstl, custom…). This file (taglibs.jsp) is included (with <%@ include file=”/common/taglibs.jsp”%>) in all jsp pages that use taglibs.
My setup is done in a way that this /common/taglibs.jsp is in eclipse project’s classpath
This used to be an old issue in eclipse WTP (https://bugs.eclipse.org/bugs/show_bug.cgi?id=82333) but it was fixed (at least working for me) using WTP 1.0M8.
For information :
I gave a try with my WTP setup, I confirm completion works with :
<%@ include file=”/common/taglibs.jsp”%>But it doesn’t anymore with a typo :
<%@ include file=”/coCHon/taglibs.jsp”%>
Immediatly the completion doesn’t provide the library tagsFrom what I picked up MyEclipse relies on WTP so I can imagine this may be the reason why it is not working with current release.
If someone is interested I could provide one of my projects to reproduce this behaviour.
Best,
Thomas
Riyad KallaMemberIf someone is interested I could provide one of my projects to reproduce this behaviour.
Yes Thomas this would be very helpful, in addition to the project please refer to this thread so I know why I’m getting it, and tell me exactly which files to edit to see the behavior you are having trouble with. I can extract a bug report from there and file it for the JSP team. [email protected]
Also MyEclipse does build on WTP so having WTP installed separately is a not a good idea. We use completed different versions, so conflicts will arise by having that setup. For 5.0 we are doing a refresh ontop of WTP which should bring things back inline though. (we were waiting all this time for WTP to get things closer to a 1.0 release before making a hueg re-integration effort)
Riyad KallaMemberThomas,
Sorry for the delay in replying, I did receieve your project shortly after you sent it, the problem boils down to your sample file being wrong. I went and editing your JSP page that includes the taglibs, and it was referencing a file that didn’t exist and a bad path, as soon as I fixed the name/path autocomplete worked fine.Additionally, I then tried adding web project capabilities to the project but was unable to because of a problem with the src/dao source folder, so I removed all those source folders (just for testing sake) and added web caps. Then i went and edited the the files you specified in your email, and noticed that your path and file name in the non-working JSP for your include statement was wrong, so I fixed it and autocomplete worked fine for the taglibs.
thogauMemberThanks rkalla for following this up.
Sounds very interesting to me, could you please send me by email the sample project I sent you with the changes you made?
I would really like to update my current projects with your modifications cause I am really missing tag lib completion!Thanks a lot,
Thomas
Riyad KallaMemberThomas,
The only changes I made were in the two files:completion-works-here.jsp
AND
completeion-does-not-work-here.jspthe file: completeion-does-not-work-here.jsp
has an incorrect path and file name reference to your completeion-does-not-work-here.jsp that has all the taglibs declared in it, it had this at the top:
<%@ include file=”/common/taglibs.jsp” %>so I changed it to:
<%@ include file=”../common/completion-works-here.jsp” %>If you would still like the project, PM me with your email address you would like it sent to.
thogauMemberOk, now I understand why you guys had problems with directory structure in appfuse.
if I use <%@ include file=”../common/taglibs.jsp” %> it works fine for completion.
However, when deployed, the “../common/taglibs.jsp” is causing problems since in my deployed project I need to access the taglibs.jsp files with absolute path.Wouldn’t it be a good thing if the editor used for completion the tld files provided by the jar files available in the classpath? (in their META-INF directory).
Anyway, thanks for good & fast support rkalla.
Thomas
Riyad KallaMemberWouldn’t it be a good thing if the editor used for completion the tld files provided by the jar files available in the classpath? (in their META-INF directory).
Yes, actually the editor supports this. As long as you include the correct <%@taglib %> directives at the top of your JSP files, the editors will resolve those URIs inside of your JAR files without a problem. The taglib directive is required, just like an import directive in a normal Java source file for example.
Atallah MouradMemberHello,
I have a related problem. MyEclipse is said to support JSP 2.0. There is a feature allowing us to include automatically a jsp file through declaration in the deployment descriptor. It makes the code even cleaner.
The reason I am not doing it yet is because it breaks the tag completion in myEclipse jsp editor.
Is there a way to work make it work that you know of ?
Thank you
Riyad KallaMemberUnfortunately this isn’t supported just yet, we appologize for the inconvenience.
-
AuthorPosts