Will it be soon available in a struts release?

-alain

-----Original Message-----
From: David Geary [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, December 12, 2000 6:47 PM
To: [EMAIL PROTECTED]; Struts dev
Subject: Re: Templating Mechanism


I just committed changes to the template:put tag and the template tld. The
tag
works exactly like it did before, but now you can put direct content in the
body
of the put tag.

If the put tag has body content:

1. You can't have a content attribute. (the tag body is the content)
2. You can't specify direct='false'. (tag body content is printed directly)

The tag will throw an exception if either of those conditions are violated.


david


"Holloway, Kevin (DEH)" wrote:

> Hi,
>
> For a trial, we modified the template code so that a <template:put> tag
with
> NO "content" attribute took its content from the tag body.  A
<template:put>
> with a "content" attribute took its content by including the file named by
> the content attribute.  This did away with the "direct" attribute
entirely.
>
> The only small issue was what if you had both content attribute and tag
> body.  An exception could be thrown.  We just ignore the body, making it
> clear in the documentation that this is what happens.
>
> We can send our code if that would help.
>
> Kevin Holloway
> Applications Architect
> Department for Environment and Heritage
> Government of South Australia
>
> -----Original Message-----
> From: Tan Siow Boon [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, November 28, 2000 11:59 AM
> To: [EMAIL PROTECTED]
> Subject: Re: Templating Mechanism
>
> Hi,
>
> We found the <template:ExtPut> tag extension provided by Oleg V Alexeev
very
> useful. Is there a plan to incorporate it into Struts 1.0 ?
>
> Regards, SiowBoon
>
> Oleg V Alexeev wrote:
>
> > Hello Andrew,
> >
> > Some time ago I write tag to extend template mechanism in this way.
> > Use it if you find it useful.
> >
> > This tag can be used like <template:put> tag except one feature - if
> > you omit content property in it, then body of this tag will be treated
> > as content. For example -
> >
> > <template:extput name="body">
> >  Some content
> > </template:extput>
> >
> > Sourse you can find in attachment. This class - whole mirror of PutTag
> > except some strings of code.
> >
> > Strings to add to the struts-template.tld
> >
> >     <tag>
> >         <name>extput</name>
> >         <tagclass>org.apache.struts.taglib.template.ExtPutTag</tagclass>
> >         <bodycontent>JSP</bodycontent>
> >         <attribute>
> >             <name>name</name>
> >             <required>true</required>
> >             <rtexprvalue>true</rtexprvalue>
> >         </attribute>
> >         <attribute>
> >             <name>content</name>
> >             <required>false</required>
> >             <rtexprvalue>true</rtexprvalue>
> >         </attribute>
> >         <attribute>
> >             <name>direct</name>
> >             <required>false</required>
> >             <rtexprvalue>true</rtexprvalue>
> >         </attribute>
> >     </tag>
> >
> > Monday, November 13, 2000, 7:45:55 PM, you wrote:
> >
> > >> The template mechanism in the article is nearly identical to the one
in
> > >> Struts. See org.apache.struts.taglib.template.
> >
> > AB> I've been looking at the templating code, and
> > AB> have what I hope is a simple question.
> >
> > AB> When using direct="true" in the <template:put> tag,
> > AB> to place literal text into the template, the text must
> > AB> necessarily be very limited because it's contained in
> > AB> the value of the content attribute.  What I'd like to be
> > AB> able to do is something like:
> >
> > AB>   <!-- the contents of a specific page -->
> >
> > AB>   <template:insert template='/pagetemplate.jsp'>
> >
> > AB>     <template:put name="navigation">
> > AB>        ... page-specific navigation here ....
> > AB>     </template:put>
> >
> > AB>     <template:put name="pagebody">
> > AB>        ... page body here...
> > AB>     </template:put>
> >
> > AB>   </template:insert>
> >
> > AB> which seems similar to your examples, except that the
> > AB> contents of the navigation and pagebody sections are
> > AB> stated in line, instead of loaded from external files,
> > AB> which I'd rather not do because of how many tiny
> > AB> little documents that would end up creating.
> >
> > AB> Is this feasible?  If the tag lib doesn't already
> > AB> support this function (and I believe it doesn't),
> > AB> is it possible to implement, and is it contrary to
> > AB> the intent?  I'm not comfortable enough with
> > AB> taglib implementation to know if doing it this way
> > AB> would affect the evaluation of the page body in
> > AB> some undesirable way.
> >
> > AB> Andy Boyko   [EMAIL PROTECTED]
> >
> > --
> > Best regards,
> >  Oleg                           mailto:[EMAIL PROTECTED]
> >
> >
------------------------------------------------------------------------
> >                      Name: ExtPutTag.java
> >    ExtPutTag.java    Type:
> application/x-unknown-content-type-java_auto_file
> >                  Encoding: base64

Reply via email to