You are viewing a plain text version of this content. The canonical link for it is here.
Posted to taglibs-user@tomcat.apache.org by Rahul P Akolkar <ak...@us.ibm.com> on 2005/06/06 19:52:53 UTC
Re: [OT] Using JSTL 1.1.2 with Tomcat 5.5 & J2SE 5.0
"Dino Klein" <za...@speakeasy.net> wrote on 06/06/2005 09:16:07 AM:
> I have two jspx files (pasted below), where one includes the other.
> When I remove the xmlns:c declaration/importation - it works; similarly,
> when I do not include the other file, it also works fine.
<snip/>
> (1) main.jspx
> ==============
> <?xml version="1.0" encoding="UTF-8"?>
> <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.0">
> <maintag xmlns:c="http://java.sun.com/jsp/jstl/core">
> <jsp:directive.include file="one.jspx"/>
> </maintag>
> </jsp:root>
> =============
>
> (2) one.jspx
> =============
> <?xml version="1.0" encoding="UTF-8"?>
> <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.0">
> <taga>hello</taga>
> </jsp:root>
> =============
This is not a JSTL issue, marked OT. In XML views of JSPs, the included
file is expanded in place. And jasper2 isn't happy because there are more
than one jsp:root elements in the XML view of main.jspx. In your case, I
don't see any need for either of the two jsp:root elements (unless you
simplified before posting, and you have a legitimate need). Remove either,
or both, and you should be fine.
I think you've raised an interesting question. It seems jasper2 will not
allow includes in the scenarios that result in more than one jsp:root
elements in the expanded view. Please check if the spec says anything
about this. If not, I would:
1) Ask for clarification on jsp spec public (unless Mark or Pierre listen
to this list, and answer)
2) Post on tomcat-user, wait for feedback (follow with a bug report,
depending on feedback)
-Rahul
Re: Using JSTL 1.1.2 with Tomcat 5.5 & J2SE 5.0
Posted by Rahul P Akolkar <ak...@us.ibm.com>.
On 6/6/05, Dino Klein <za...@speakeasy.net> wrote:
> I think I'll file a bug report, since my knowledge about TLVs is zero.
TLVs perform validation that is beyond TLDs, common example is validation
of the type <my:foo/> can only be a child of <my:bar/> etc.
I was itching for a better explanation of this issue, so I browsed the
sources. Since the SAX parsing attempted by the JSTL TLVs on the expanded
XML view was failing, it was time to look at the expanded XML view
generation. jasper2 (which is the relevant JSP compiler for your setup)
added the xmlns:jsp attribute twice to the jsp:root of the expanded XML
view in your scenario (now the stack trace makes sense ;-).
Details and proposed patch [
http://issues.apache.org/bugzilla/show_bug.cgi?id=35252 ], you may follow
this issue on tomcat-dev. I added your name in the body of the bug report
as the original reporter of the bug.
-Rahul
Re: Using JSTL 1.1.2 with Tomcat 5.5 & J2SE 5.0
Posted by Dino Klein <za...@speakeasy.net>.
I think I'll file a bug report, since my knowledge about TLVs is zero.
In case it might interest anybody - I gave the pages a try on Tomcat
5.0.28 with 1.4.2 (on
MacOS X), with the same results; I did this to make sure that it wasn't
some sort of an incompatibility issue with J2SE 5.0.
Rahul P Akolkar wrote:
> Dino Klein" <za...@speakeasy.net> wrote on 06/06/2005 03:44:38 PM:
> <snip/>
>
>>I did some primitive debugging, and all I could find out is that if I
>
> use
>
>>xmlns:fn="http://java.sun.com/jsp/jstl/functions", then I have no
>>problems; I checked the TLDs, and I noticed that it does not include a
>>validator like the rest (c, sql, fmt, x - all do, and cause problems).
>
>
> I tried this, you are right. It turns out the bit in my earlier email that
> talked about multiple jsp:root's in the expanded view was FUD, my sincere
> apologies. I've removed the OT marker. Unless someone else has an
> explanation, you can:
> 1) Dig into the JSTL TLV impls
> 2) File a bug report (if you're sufficiently convinced)
> The two options are not mutually exclusive ;-)
>
> -Rahul
>
---------------------------------------------------------------------
To unsubscribe, e-mail: taglibs-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: taglibs-user-help@jakarta.apache.org
Re: Using JSTL 1.1.2 with Tomcat 5.5 & J2SE 5.0
Posted by Rahul P Akolkar <ak...@us.ibm.com>.
Dino Klein" <za...@speakeasy.net> wrote on 06/06/2005 03:44:38 PM:
<snip/>
> I did some primitive debugging, and all I could find out is that if I
use
> xmlns:fn="http://java.sun.com/jsp/jstl/functions", then I have no
> problems; I checked the TLDs, and I noticed that it does not include a
> validator like the rest (c, sql, fmt, x - all do, and cause problems).
I tried this, you are right. It turns out the bit in my earlier email that
talked about multiple jsp:root's in the expanded view was FUD, my sincere
apologies. I've removed the OT marker. Unless someone else has an
explanation, you can:
1) Dig into the JSTL TLV impls
2) File a bug report (if you're sufficiently convinced)
The two options are not mutually exclusive ;-)
-Rahul
Re: [OT] Using JSTL 1.1.2 with Tomcat 5.5 & J2SE 5.0
Posted by Dino Klein <za...@speakeasy.net>.
> This is not a JSTL issue, marked OT. In XML views of JSPs, the included
> file is expanded in place. And jasper2 isn't happy because there are more
> than one jsp:root elements in the XML view of main.jspx. In your case, I
> don't see any need for either of the two jsp:root elements (unless you
> simplified before posting, and you have a legitimate need). Remove
> either,
> or both, and you should be fine.
I've created the two files for testing purpose (after having probs.), and
the exception I was talking about is thrown by those two files. However,
I'd like to reiterate the fact that removing the xml:c="...." declaration,
gets rid of the problem, and the inclusion goes ahead; can't it be somehow
related to the JTLS's TagLibraryValidator?
I did some primitive debugging, and all I could find out is that if I use
xmlns:fn="http://java.sun.com/jsp/jstl/functions", then I have no
problems; I checked the TLDs, and I noticed that it does not include a
validator like the rest (c, sql, fmt, x - all do, and cause problems).
> I think you've raised an interesting question. It seems jasper2 will not
> allow includes in the scenarios that result in more than one jsp:root
> elements in the expanded view. Please check if the spec says anything
> about this. If not, I would:
> 1) Ask for clarification on jsp spec public (unless Mark or Pierre listen
> to this list, and answer)
> 2) Post on tomcat-user, wait for feedback (follow with a bug report,
> depending on feedback)
From what I read in JSP.1.10.5, same-syntax inclusion, and mixed-syntax
inclusions are allowed. I'll definitely pursue this, but I'd like to get
your response for my comments above.
Thanks.
---------------------------------------------------------------------
To unsubscribe, e-mail: taglibs-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: taglibs-user-help@jakarta.apache.org