Community
Participate
Working Groups
declared a taglib at .jsp page, but no code completion neither validation of attributes of tag are offered by editor. Example of source code: <%@ taglib prefix='c' uri='http://java.sun.com/jsp/jstl/core'%> <c:if test="${true}"> Ok! </c:if>
Where is the standard.jar located and where is the .jsp located?
I have several .jsp files under WebContent and sub-folders inside my project. None recognize JSTL tags. standard.jar is at WebContent/WEB-INF/lib folder.
Researching more, I observed JSTL tags are recognized if they are only used inside and HTML tag. The example in original message on bug request is wrong. A correct example where JSTL auto complete and validation doesn't work is: <a href='<c:url value="/protected/test/index.jsp"/>'>Click here!</a> Sorry by the first wrong sample, I realize that a wrong sample make you research much more than necessary :( Richter
Doesn't recognise JSTL tags Setup.. All the jstl jars are in WEB-INF/lib All the tlds are in WEB-INF And JSP is in Parent folder of WEB-INF I'm encountering org.apache.jasper.JasperException: /jstl4.jsp(25,4) According to TLD or attribute directive in tag file, attribute value does not accept any expressions Jsp is simple.It gives me error at <c:out <%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %> .. .. .. <c:set var="hello" value="JSTL Done!"/> <c:out value="${hello}"/> (In reply to comment #3) > Researching more, I observed JSTL tags are recognized if they are only used > inside and HTML tag. > The example in original message on bug request is wrong. A correct example where > JSTL auto complete and validation doesn't work is: > <a href='<c:url value="/protected/test/index.jsp"/>'>Click here!</a> > Sorry by the first wrong sample, I realize that a wrong sample make you research > much more than necessary :( > Richter (In reply to comment #3) > Researching more, I observed JSTL tags are recognized if they are only used > inside and HTML tag. > The example in original message on bug request is wrong. A correct example where > JSTL auto complete and validation doesn't work is: > <a href='<c:url value="/protected/test/index.jsp"/>'>Click here!</a> > Sorry by the first wrong sample, I realize that a wrong sample make you research > much more than necessary :( > Richter
The correct uri for taglib isn't "http://java.sun.com/jsp/jstl/core" (I'm supposing you are using jstl 1.1 - as I am). I don't remember well, but "http://java.sun.com/jstl/core" doesn't allow scriplets everywhere (and is jstl 1.0 based, could someone confirm this?). AFAIK, there is no need to declare jstl tags in web.xml. Putting the standard.jar and jstl.jar in WEB-INF/lib folder does the job (at last, I've been working in this way for a long time, without any problems at all). (In reply to comment #4) > Doesn't recognise JSTL tags > > Setup.. > All the jstl jars are in WEB-INF/lib > All the tlds are in WEB-INF > And JSP is in Parent folder of WEB-INF > > I'm encountering > org.apache.jasper.JasperException: /jstl4.jsp(25,4) According to TLD or > attribute directive in tag file, attribute value does not accept any expressions > > Jsp is simple.It gives me error at <c:out > > <%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %> > .. > .. > .. > <c:set var="hello" value="JSTL Done!"/> > <c:out value="${hello}"/>
Still not work on 1.0. A better use case for this problem is: <img src='<c: Then type "ctrl+space" and nothing is suggested. I think is because the "<c:url" I'm trying to type is under ' (apostrophes).
Changed to 1.0, because this doesn't work on 0.7 neither 1.0.
(In reply to comment #4) > org.apache.jasper.JasperException: /jstl4.jsp(25,4) According to TLD or > attribute directive in tag file, attribute value does not accept any expressions This is an error reported by the server. I'm changing this to an enhancement because it's functionality missing from custom tags within an attribute value, and I suspect that the tags are recognized otherwise in more current releases.
Created attachment 150268 [details] Fix Patch Patch cleans up the way content assist is given in attribute value regions. Patch results: * Custom tags will now be proposed in attribute value regions * in the case of: <img align=" ** enumerated values and custom tags will be proposed (before neiter were proposed because of the complications of not having the attribute value region closed
Created attachment 151343 [details] Fix Patch Update 1 The last patch accidentally also included the patch for Bug 292765.
Created attachment 153604 [details] Fix Patch Update 2 Updated the patch again to deal with more conflicting changes that have already gone in. Also there was an issue with the include options on the ModeqlQuery call, it was 0 for some reason and it really needed to be ModelQuery.INCLUDE_ALL
Comment on attachment 153604 [details] Fix Patch Update 2 This patch has become stale but I have incorporated it into the fix for Bug 258999.
Rather then fix this twice, I will just wait for the fix for Bug 258999 to get in and then verify this bug afterwords.
(In reply to comment #13) > Rather then fix this twice, I will just wait for the fix for Bug 258999 to get > in and then verify this bug afterwords. Unfortunately it would seem part of the fix that was needed for this did not make it into Bug 258999. Will attach needed patch.
It turns out the fix for this was originally in the patch for Bug 258999 but it got removed near the end of the iteration of the patch because it was not known why it was in there. Now we know. The problem is that HTMLModelQueryImpl#getAvailableContent gets a class cast exception on line 88 CMElementDeclaration candidate = (CMElementDeclaration) candidates.elementAt(i); The candidate at fault is a org.eclipse.wst.html.core.internal.contentmodel.HTMLAttrDeclImpl. Patch to follow. Nitin, I am CCing you on this because you are the one who asked I remove it from Bug 258999 because at the time I could not explain why it was there other then to say, if I put it in there it was for some specific case, well I found the case :)
Created attachment 162108 [details] Fix Patch with JUnits This has the patch and a new JUnit to test for regression. Test needs update to test zip file which I will attach separately.
Created attachment 162110 [details] JUnit ZIP update This is a new JSP content assist testing zip to go in org.eclipse.jst.jsp.ui.tests/projecttestfiles/TestJSPContentAssistComputers.zip
With the addition of the new cycling proposal list, we'd have a regression without this patch. Reason being is that there was nothing guarding against non-CMElementDeclarations coming through. As a byproduct of the implementation of content assist cycling and the general fix to check for the declaration type, this should be resolved. I'm approving after a tweak to remove the unnecessary else clause.