RE: Templating Mechanism

2000-12-13 Thread Alain Hubert

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
  nameextput/name
  tagclassorg.apache.struts.taglib.template.ExtPutTag/tagclass
  bodycontentJSP/bodycontent
  attribute
  namename/name
  requiredtrue/required
  rtexprvaluetrue/rtexprvalue
  /attribute
  attribute
  namecontent/name
  requiredfalse/required
  rtexprvaluetrue/rtexprvalue
  /attribute
  attribute
  namedirect/name
  requiredfalse/required
  rtexprvaluetrue/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.javaType:
 application/x-unknown-content-type-java_auto_file
   Encoding: base64



Re: Templating Mechanism

2000-12-12 Thread David Geary

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
  nameextput/name
  tagclassorg.apache.struts.taglib.template.ExtPutTag/tagclass
  bodycontentJSP/bodycontent
  attribute
  namename/name
  requiredtrue/required
  rtexprvaluetrue/rtexprvalue
  /attribute
  attribute
  namecontent/name
  requiredfalse/required
  rtexprvaluetrue/rtexprvalue
  /attribute
  attribute
  namedirect/name
  requiredfalse/required
  rtexprvaluetrue/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.javaType:
 application/x-unknown-content-type-java_auto_file
   Encoding: base64




RE: Templating Mechanism

2000-11-27 Thread Holloway, Kevin (DEH)

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
 nameextput/name
 tagclassorg.apache.struts.taglib.template.ExtPutTag/tagclass
 bodycontentJSP/bodycontent
 attribute
 namename/name
 requiredtrue/required
 rtexprvaluetrue/rtexprvalue
 /attribute
 attribute
 namecontent/name
 requiredfalse/required
 rtexprvaluetrue/rtexprvalue
 /attribute
 attribute
 namedirect/name
 requiredfalse/required
 rtexprvaluetrue/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,
  Olegmailto:[EMAIL PROTECTED]

   
  Name: ExtPutTag.java
ExtPutTag.javaType:
application/x-unknown-content-type-java_auto_file
  Encoding: base64



Re: Templating Mechanism

2000-11-12 Thread Matas_Veitas



Take a look at this Sept Javaworld article. It explains how to use a JSP
template mechanism with  three custom tags.

http://www.javaworld.com/javaworld/jw-09-2000/jw-0915-jspweb.html

Matt





"Vincent Harcq" [EMAIL PROTECTED] on 11/12/2000 10:46:39 PM

Please respond to [EMAIL PROTECTED]; Please respond to
  [EMAIL PROTECTED]

To:   [EMAIL PROTECTED]
cc:(bcc: Matas Veitas/AMS/AMSINC)

Subject:  Templating Mechanism

After reading the User Guide, I am not sure if Struts does have a Templating
Mechanism or not.
By that I mean one (or 2 or 3) that defines the basic structure of the site
in 3 (for example) parts : a header, the left panel and a body.  This
template will always be the jsp:forward and have two jsp:include to include
the two static (for example) header and left panes pages and one jsp:include
that would get a parameter from the request to now which page to include.
Something similar to the PetStore example.

I like that because it push a lot of DIV or LAYER HTML code in only the
template page.

Is it possible ?


_
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com











Re: Templating Mechanism

2000-11-12 Thread David Geary

The template mechanism in the article is nearly identical to the one in
Struts. See org.apache.struts.taglib.template.


david

[EMAIL PROTECTED] wrote:

 Take a look at this Sept Javaworld article. It explains how to use a JSP
 template mechanism with  three custom tags.

 http://www.javaworld.com/javaworld/jw-09-2000/jw-0915-jspweb.html

 Matt

 "Vincent Harcq" [EMAIL PROTECTED] on 11/12/2000 10:46:39 PM

 Please respond to [EMAIL PROTECTED]; Please respond to
   [EMAIL PROTECTED]

 To:   [EMAIL PROTECTED]
 cc:(bcc: Matas Veitas/AMS/AMSINC)

 Subject:  Templating Mechanism

 After reading the User Guide, I am not sure if Struts does have a Templating
 Mechanism or not.
 By that I mean one (or 2 or 3) that defines the basic structure of the site
 in 3 (for example) parts : a header, the left panel and a body.  This
 template will always be the jsp:forward and have two jsp:include to include
 the two static (for example) header and left panes pages and one jsp:include
 that would get a parameter from the request to now which page to include.
 Something similar to the PetStore example.

 I like that because it push a lot of DIV or LAYER HTML code in only the
 template page.

 Is it possible ?

 _
 Do You Yahoo!?
 Get your free @yahoo.com address at http://mail.yahoo.com




Re: Templating Mechanism

2000-11-12 Thread Craig R. McClanahan

David Geary wrote:

 The template mechanism in the article is nearly identical to the one in
 Struts. See org.apache.struts.taglib.template.


I just updated the documentation on the website http://jakarta.apache.org/struts
to be up to date with respect to the changes for 1.0.  You'll now see the template
library documented.


 david


Craig



 [EMAIL PROTECTED] wrote:

  Take a look at this Sept Javaworld article. It explains how to use a JSP
  template mechanism with  three custom tags.
 
  http://www.javaworld.com/javaworld/jw-09-2000/jw-0915-jspweb.html
 
  Matt
 
  "Vincent Harcq" [EMAIL PROTECTED] on 11/12/2000 10:46:39 PM
 
  Please respond to [EMAIL PROTECTED]; Please respond to
[EMAIL PROTECTED]
 
  To:   [EMAIL PROTECTED]
  cc:(bcc: Matas Veitas/AMS/AMSINC)
 
  Subject:  Templating Mechanism
 
  After reading the User Guide, I am not sure if Struts does have a Templating
  Mechanism or not.
  By that I mean one (or 2 or 3) that defines the basic structure of the site
  in 3 (for example) parts : a header, the left panel and a body.  This
  template will always be the jsp:forward and have two jsp:include to include
  the two static (for example) header and left panes pages and one jsp:include
  that would get a parameter from the request to now which page to include.
  Something similar to the PetStore example.
 
  I like that because it push a lot of DIV or LAYER HTML code in only the
  template page.
 
  Is it possible ?
 
  _
  Do You Yahoo!?
  Get your free @yahoo.com address at http://mail.yahoo.com