JSP document tag content assist not working inside included (fragment) files [message #175757] |
Mon, 31 July 2006 03:06 |
Eclipse User |
|
|
|
Originally posted by: tony.debat.criticalpath.net
Hi,
I'm using eclipse version 3.2.0 with wtp 1.5.0.
If I create a jsp document (.jspx) with a jsp:root that contains the jstl
core in the namespace then I will see content assist for the <c: tags such
as <c:forEach>.
<?xml version="1.0" encoding="ISO-8859-1" ?>
<jsp:root xmlns:jsp="http://java.sun.com/JSP/Page"
xmlns:c="http://java.sun.com/jsp/jstl/core"
version="2.0">
<!-- jstl content assist works! -->
<c:forEach begin="" items=""></c:forEach>
<jsp:directive.include file="Header.jspf" />
</jsp:root>
But when I include the fragment "Header.jspf" that contains a <div> tag,
the content assist for the jstl core is no longer available.
Header.jspf:
<div>
<!-- no jstl content assist here. -->
</div>
I also tried this, but it didn't work.
Header.jspf:
<div xmlns:c="http://java.sun.com/jsp/jstl/core">
<!-- no jstl content assist here. -->
</div>
Under the JSP Fragments preferences I checked "Validate JSP fragments" but
I'm not sure if validation is related to content assist.
I also tried adding an empty jsp:root tag to the fragement with the jstl
core namespace and it did work. But adding the jsp:root tag isn't a good
solution because tomcat doesn't permit nested jsp:root tags.
Header.jspf:
<div xmlns:c="http://java.sun.com/jsp/jstl/core">
<jsp:root xmlns:c="http://java.sun.com/jsp/jstl/core">
</jsp:root>
<!-- jstl content assist works! -->
<c:forEach begin="" items=""></c:forEach>
</div>
Should content assist work in this situation?
If it already works and I'm doing something wrong, can you let me know
what steps I should take to get it working?
Thanks,
Tony
|
|
|
Re: JSP document tag content assist not working inside included (fragment) files [message #176120 is a reply to message #175757] |
Wed, 02 August 2006 14:12 |
|
While editing the fragment, there's no way to tell which (of
possibly many) JSP files are including the fragment and affecting
the list of tags it can use. Unless the taglib directive is in the
same file or one that *it* includes, those tags won't be enabled.
The "xmlns:" support is also limited to the jsp:root element when
seen as top-level tag. I don't know of any plans to change that, so
I'd suggest putting the taglib directive for the JSTL Core into the
header file itself. It should then be usable in both the fragment
and any JSP files including it.
--
- Nitin
_
Nitin Dahyabhai
Eclipse Web Tools Platform
|
|
|
Powered by
FUDForum. Page generated in 0.01729 seconds