tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andreas Junghans" <>
Subject Re: DO NOT REPLY [Bug 5785] - XML request time attribute notgenerated correctly
Date Tue, 12 Mar 2002 08:46:06 GMT

> *moan* Now I have to convert HTML tags we have that use request-time
> into custom tags so that we can give them request time attributes. *sigh*
Is it going
> to change in 1.3? I mean, XSLT allows all *non*-XSLT tags to have the
> of request-time attributes. I guess I thought JSP would be the same. It
just makes
> sense, doesn't it? :)

We ran into exactly the same problem. IMO it's a really ugly spec bug :-(  I
already sent a comment about that to, but got
no response. We (kind of) solved the problem by wrapping our pages in custom
tags that buffer their body content and parse it by hand. Of course, this
doesn't work for arbitrary expressions without putting a lot of effort into
it. In our case, we just look up pageContext attributes so that

<img src="%= someSrc %"/>

is translated into

<img src="someImg"/>

with "someImg" being the value of pageContext.getAttribute("someSrc").

Since this is not satisfactory, we're currently working at a solution that
takes an XML document that looks like a JSP and translates it into a
non-XML-JSP (via XSLT). During translation, all %= = attribute values are
replaced by the appropriate code. This way, you're still working with
something that looks like an XML-JSP but with RT attribute expressions in
_all_ tags. If you're interested, I can send you more information. Note:
This work is done within a diploma thesis, so it's absolutely free to use,
copy, change, ...

> Well, maybe I can kill two birds with one stone: sooner or later I need to
get real
> HTML syntax out of my JSP1.2 pages anyway, maybe I will just get all the
> custom tags to output proper HTML syntax tags. The performance is going to
> bad though...

I really wouldn't do that, it's too work for what you get at the end. BTW, I
don't think you can sell <img../> (or other html tags) to Jasper as custom
tags without a namespace prefix: <xyz:img.../>. And this looks _really_

Best regards

  Andreas Junghans

PS Sorry for being so lengthy, it's a bad habit of mine ...

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message