You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by James Howe <jw...@allencreek.com> on 2001/02/26 19:46:08 UTC
Base tag question
Is there some reason why the base tag defined in the HTML tag library
doesn't let you specify the optional target attribute? I'm working with a
frames based web application and I need to use both the href and target
attributes. I know I could subclass the custom base tag, but before I do,
I was wondering if there was any particular reason why the standard Struts
base tag does let the user specify the target.
Thanks.
Re: Base tag question
Posted by Incze Lajos <in...@mail.matav.hu>.
> I thought target was part of the spec. In looking at the spec on
> www.w3c.org, the following page specifically mentions the target attribute:
>
> http://www.w3.org/TR/html4/struct/links.html#edef-BASE
>
> However, the DTD does not mention the target attribute so I'm a bit
> confused.
I have my own copy of http://www.w3.org/TR/1999/REC-html401-19991224
and can assert that the spec does specify 'target' attribute in lieau
of frames. The attributes.html file contains a table what tags are
involved:
Name Related Elements Type Default Depr DTD Comment
---- ---------------- ------------ -------- ---- --- --------------
... ... ... ... ... ... ...
target A, AREA, BASE, %FrameTarget; #IMPLIED L render in this
FORM, LINK frame
So, target is not even deprecated, The "L" in the DTD columne means
"Loose DTD" according to the legend, which explains why you don't
find it in the strict (?) DTD. Most "L" attributes are deprecated
as well, but this is not. (The other not-D L attribute is "height"
for IFRAME.)
Form this table tyou can navigate to a very detailed explanation of the
target attribute, where the BASE tag is mentioned explicitly in the
attribute semantics:
--
"16.3.2 Target semantics
User agents should determine the target frame in which to load
a linked resource according to the following precedences (highest
priority to lowest):
1.If an element has its target attribute set to a known frame, when
the element is activated (i.e., a link is followed or a form is
processed), the resource designated by the element should be loaded
into the target frame.
2.If an element does not have the target attribute set but the BASE
element does, the BASE element's target attribute determines the frame.
3.If neither the element nor the BASE element refers to a target,
the resource designated by the element should be loaded into
the frame containing the element.
4.If any target attribute refers to an unknown frame F, the user agent
should create a new window and frame, assign the name F to the frame,
and load the resource designated by the element in the new frame.
User agents may provide users with a mechanism to override the target
attribute."
--
So, we have an attribute which is specified, not deprecated but "L" - and not
found in the strict DTD. Also, there are some attributes flagged with "F"
which stands for "Frameset DTD". Seemengly, the decision
is whether Struts taglibs support _frames_ (not D, L+F) or not (strict
HTML DTD). incze
Re: Base tag question
Posted by "Craig R. McClanahan" <Cr...@eng.sun.com>.
James Howe wrote:
> At 05:35 PM 2/26/2001 -0800, you wrote:
> >James Howe wrote:
> >
> > > Is there some reason why the base tag defined in the HTML tag library
> > > doesn't let you specify the optional target attribute? I'm working with a
> > > frames based web application and I need to use both the href and target
> > > attributes. I know I could subclass the custom base tag, but before I do,
> > > I was wondering if there was any particular reason why the standard Struts
> > > base tag does let the user specify the target.
> > >
> >
> >I prefer not to support attributes that aren't in the official HTML 4.01
> >specs, and this is one of those. You're welcome to support it yourself
> >in a subclass, however.
> >
> > >
> > > Thanks.
> >
> >Craig
>
> I thought target was part of the spec. In looking at the spec on
> www.w3c.org, the following page specifically mentions the target attribute:
>
> http://www.w3.org/TR/html4/struct/links.html#edef-BASE
>
> However, the DTD does not mention the target attribute so I'm a bit
> confused.
That's what did me in ... I looked at the DTD and did not see it there without
reading the corresponding text (isn't that why the DTD stuff is highlighted in
color? :-). It's also described specifically as related to <base> in Section
16.3.1. It's also listed explicitly in the attributes list:
<http://www.w3.org/TR/html4/index/attributes.html>
> Perhaps target will be superceded by a style-sheet
> specification? If you don't want to change the base tag implementation I
> will just plan on creating my own subclass.
>
>
I'll go ahead and add it (and also on the other supported tags as appropriate).
> Thanks.
>
> James W. Howe mailto:jwh@allencreek.com
> Allen Creek Software, Inc. pgpkey: http://ic.net/~jwh/pgpkey.html
> Ann Arbor, MI 48103
Craig
Re: Base tag question
Posted by James Howe <jw...@allencreek.com>.
At 05:35 PM 2/26/2001 -0800, you wrote:
>James Howe wrote:
>
> > Is there some reason why the base tag defined in the HTML tag library
> > doesn't let you specify the optional target attribute? I'm working with a
> > frames based web application and I need to use both the href and target
> > attributes. I know I could subclass the custom base tag, but before I do,
> > I was wondering if there was any particular reason why the standard Struts
> > base tag does let the user specify the target.
> >
>
>I prefer not to support attributes that aren't in the official HTML 4.01
>specs, and this is one of those. You're welcome to support it yourself
>in a subclass, however.
>
> >
> > Thanks.
>
>Craig
I thought target was part of the spec. In looking at the spec on
www.w3c.org, the following page specifically mentions the target attribute:
http://www.w3.org/TR/html4/struct/links.html#edef-BASE
However, the DTD does not mention the target attribute so I'm a bit
confused. Perhaps target will be superceded by a style-sheet
specification? If you don't want to change the base tag implementation I
will just plan on creating my own subclass.
Thanks.
James W. Howe mailto:jwh@allencreek.com
Allen Creek Software, Inc. pgpkey: http://ic.net/~jwh/pgpkey.html
Ann Arbor, MI 48103
Re: Base tag question
Posted by "Craig R. McClanahan" <Cr...@eng.sun.com>.
James Howe wrote:
> Is there some reason why the base tag defined in the HTML tag library
> doesn't let you specify the optional target attribute? I'm working with a
> frames based web application and I need to use both the href and target
> attributes. I know I could subclass the custom base tag, but before I do,
> I was wondering if there was any particular reason why the standard Struts
> base tag does let the user specify the target.
>
I prefer not to support attributes that aren't in the official HTML 4.01
specs, and this is one of those. You're welcome to support it yourself
in a
subclass, however.
>
> Thanks.
Craig