You are viewing a plain text version of this content. The canonical link for it is here.
Posted to taglibs-dev@jakarta.apache.org by Stefan Kost <s....@webmacher.de> on 2001/12/12 16:43:54 UTC

FO Tag Library

Hi,

I have now written a FO taglibray and it sort of works. You can write
things like :
<%@ page session="false" %>
<%@ taglib uri="http://jakarta.apache.org/taglibs/fo-1.0" prefix="fop"%>
<fop:process style="pdf">
  <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
    ...
  </fo:root>
</fop:process>

and you'll get a pdf beamed right into your browser.
Next I've tried things like :
<%@ page session="false" %>
<%@ taglib uri="http://jakarta.apache.org/taglibs/fo-1.0" prefix="fop"%>
<fop:process style="pdf">
  <xsl:apply xsl="/fop/index.xsl">
    <page>
      <title>
        pdf-test
      </title>
      <content>
        Hallo
      </content>
    </page>
  </xsl:apply>
</fop:process>

but all I get is :
javax.servlet.ServletException: TransformerException
	at
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:459)
	at
fop._0002ffop_0002findex_0002ejspindex_jsp_5._jspService(_0002ffop_0002findex_0002ejspindex_jsp_5.java:145)

...

Root cause:

javax.servlet.jsp.JspException: TransformerException
	at org.apache.taglibs.xsl.ApplyTag.doEndTag(ApplyTag.java:360)
	at
fop._0002ffop_0002findex_0002ejspindex_jsp_5._jspService(_0002ffop_0002findex_0002ejspindex_jsp_5.java:116)


The funny thing is, when I just comment out the fop-tag, the xsl works
fine and I get the fo-xml as the page result.
Any ideas ? 

Stefan
-- 

 < W E B M A C H E R > 
EDV+INTERNETSERVICE GMBH

POST: August Bebel Str. 69
      04275 Leipzig

FON:  +49 341 30 34 832
FAX:  +49 341 30 34 840
WEB:  www.webmacher.de


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: FO Tag Library (problem with jsp1.1)

Posted by Stefan Kost <s....@webmacher.de>.
Hi Hi,

answering my own post. The problem (see cited part at the bottom) is due
to that jsp 1.1 does not allow nested body tags witch flush their
buffers. It's been said that this will work with jsp 1.2 (as found in
tomcat 4.X), but I am unable to verify this at the moment as there are a
few bugs in the tomcat 4.x class loader (class cast exception for
xerces.jar).
Does anyone know a workaround for this ?
<bugging>
  And errm, what about taglib inclusion ? (there have be two +1s)
  - if   you have anything against it, please tell me - so that
  we can argue about it.
</bugging>

Stefan
> Hi,
> 
> I have now written a FO taglibray and it sort of works. You can write
> things like :
> <%@ page session="false" %>
> <%@ taglib uri="http://jakarta.apache.org/taglibs/fo-1.0" prefix="fop"%>
> <fop:process style="pdf">
>   <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
>     ...
>   </fo:root>
> </fop:process>
> 
> and you'll get a pdf beamed right into your browser.
> Next I've tried things like :
> <%@ page session="false" %>
> <%@ taglib uri="http://jakarta.apache.org/taglibs/fo-1.0" prefix="fop"%>
> <fop:process style="pdf">
>   <xsl:apply xsl="/fop/index.xsl">
>     <page>
>       <title>
>         pdf-test
>       </title>
>       <content>
>         Hallo
>       </content>
>     </page>
>   </xsl:apply>
> </fop:process>
> 
> but all I get is :
> javax.servlet.ServletException: TransformerException
> 	at
> org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:459)
> 	at
> fop._0002ffop_0002findex_0002ejspindex_jsp_5._jspService(_0002ffop_0002findex_0002ejspindex_jsp_5.java:145)
> 
> ...
> 
> Root cause:
> 
> javax.servlet.jsp.JspException: TransformerException
> 	at org.apache.taglibs.xsl.ApplyTag.doEndTag(ApplyTag.java:360)
> 	at
> fop._0002ffop_0002findex_0002ejspindex_jsp_5._jspService(_0002ffop_0002findex_0002ejspindex_jsp_5.java:116)
> 
> 
> The funny thing is, when I just comment out the fop-tag, the xsl works
> fine and I get the fo-xml as the page result.
> Any ideas ? 
> 
> Stefan
> -- 
> 
>  < W E B M A C H E R > 
> EDV+INTERNETSERVICE GMBH
> 
> POST: August Bebel Str. 69
>       04275 Leipzig
> 
> FON:  +49 341 30 34 832
> FAX:  +49 341 30 34 840
> WEB:  www.webmacher.de
> 
> 
> --
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>
> 
-- 

 < W E B M A C H E R > 
EDV+INTERNETSERVICE GMBH

POST: August Bebel Str. 69
      04275 Leipzig

FON:  +49 341 30 34 832
FAX:  +49 341 30 34 840
WEB:  www.webmacher.de


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Taglib variables

Posted by ba...@generationjava.com.
> So if your idea behind that is to create a generic Tag class which will
> have get/set methods for 'use' attribute and then all subclassing tags
> will just use "getUse()"?

The taglib already has a generic abstract class, so it would happen this
way, but it's not something I would expect to use beyond the taglib.
Really I was just hunting to see if a informal standard existed.

It seems that the answer is that while tags often write their output into
variables, they don't get their input from them. Rather an expression
language (ie $var_name) or the value itself is pushed in.

Bay


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Taglib variables

Posted by Igor Fedulov <if...@outlook.net>.
> Then, the taglib, rather than using the body of the tag or a 'string'
> attribute, would do:
>
>     Object target = pageContext.getAttribute( getUse() );
>
> Is that making any more sense?

IMHO name of input attribute(s) name(s) usually vary from tag to tag,
because sometimes you want to be more specific about what you expect from
user as input variable. I.e.:

<olt:fetchDataSet dataset="<%=invoiceDS%>"
vars="id|date|companyname|amount">
...
</olt:fetchDataSet>

or

<olt:fetchRequest request="<%=request%>"
vars="id:identifier|s:searchString">
...
</olt:fetchRequest>

So if your idea behind that is to create a generic Tag class which will
have get/set methods for 'use' attribute and then all subclassing tags
will just use "getUse()"?

Best regards,
--
HTTP is a stateless protocol, and the Internet is a stateless development
environment
--
Igor Fedulov
E-mail : ifedulov@outlook.net
Work Ph: 773.775.1595
Home Ph: 773.281.8938
Cell Ph: 773.580.5935




--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Taglib variables

Posted by ba...@generationjava.com.
I suspect it's my understanding of the mechanics of the EL which is to
blame :)

If I have a HashMap, can I just pass it in with  $map ? Or will that call
.toString()?

For now I'll just offer a string attribute that people can do '$name'
into.

Bay

On Fri, 14 Dec 2001, Shawn Bayern wrote:

> Sure - you're essentially implementing your own, slimmed-down expression
> language.  Creating a convention for this EL might make sense (e.g.,
> 'use'), or it might be better to name the attribute based on its intended
> use (e.g., 'string').
>
> Shawn
>
> On Fri, 14 Dec 2001 bayard@generationjava.com wrote:
>
> > Sorry. I'm mixing the words variable and attribute too much. Let me try
> > for another example.
> >
> > <jc:set var="name" value="Unknown"/>
> > <str:capitalize var="newname" use="name"/>
> >
> > or
> >
> > <company:dbWrapper column="PQR_NAME" id="$session:id" var="name"/>
> > <str:capitalize var="newname" use="name"/>
> >
> > Then, the taglib, rather than using the body of the tag or a 'string'
> > attribute, would do:
> >
> >     Object target = pageContext.getAttribute( getUse() );
> >
> > Is that making any more sense?
> >
> > Bay
> >
> > On Fri, 14 Dec 2001, Shawn Bayern wrote:
> >
> > > I'm not sure I'm following, but it sounds like you're looking to treat the
> > > input as potentially a collection of Strings...?  If that's the case, then
> > > by analogy with <c:forEach> ('items'), what about calling the attribute
> > > 'strings'?
> > >
> > > Shawn
> > >
> > > On Fri, 14 Dec 2001 bayard@generationjava.com wrote:
> > >
> > > > 'value' would be wrong in this case though Shawn. Or at least for how I
> > > > was planning to pass information in.
> > > >
> > > > Using your examples:
> > > >
> > > > <str:capitalize var="BIG" value="$little"/>
> > > >
> > > > <str:capitalize var="BIG" use="little"/>    (I removed the $)
> > > >
> > > > ie) the 'use' attribute I was discussing would say use the variable
> > > > 'little' in the pageContext and not, here's a string to act upon.
> > > >
> > > > While my string example could happily pass strings to act upon in, I am
> > > > assuming there are other times when a Collection or array or just some
> > > > unknown object would want to be passed in and dealt with accordingly.
> > > >
> > > > Any ideas?
> > > >
> > > > Bay
> > > >
> > > > On Fri, 14 Dec 2001, Shawn Bayern wrote:
> > > >
> > > > > Bay,
> > > > >
> > > > > Good question!  My personal sense is that the JSTL EG didn't feel a need
> > > > > to standardize on attributes representing 'source,' given that the uses of
> > > > > sources vary so widely -- and also given that many tags take multiple
> > > > > inputs.  (By contrast, only a few tags output multiple variables.)
> > > > >
> > > > > I'd say 'value' is probably the most generic one we use, when the input
> > > > > variable's purpose is general and there's only a single one.  (For
> > > > > instance, <c:expr> uses 'value'.)  But, for instance, JSTL specifically
> > > > > uses 'select' instead of 'value' for XPath expressions -- in order to help
> > > > > set them apart and make them more noticeable.
> > > > >
> > > > > I think it's much more important to be consistent when the *use* is the
> > > > > same than when it's not.  For instance, in JSTL, source XML documents are
> > > > > always accessed by 'source' (unless they're XSLT stylesheets).
> > > > >
> > > > > To answer your specific question, I'd personally encourage 'value', to
> > > > > match <c:expr>.  For instance,
> > > > >
> > > > >   <str:capitalize var="BIG" value="$little"/>
> > > > >
> > > > > looks better to me personally than
> > > > >
> > > > >   <str:capitalize var="BIG" use="$little"/>
> > > > >
> > > > > ("Use" seems to make more sense to the tag developer than to the user.)
> > > > >
> > > > > For the 'string' tags, though, 'string' also wouldn't be a bad choice:
> > > > >
> > > > >   <str:capitalize var="BIG" string="$little"/>
> > > > >
> > > > > Shawn
> > > > >
> > > > > On Fri, 14 Dec 2001 bayard@generationjava.com wrote:
> > > > >
> > > > > > Hopefully a simple question.
> > > > > >
> > > > > > The JSTL (and others I'm sure) uses the 'var' attriubute to mean:
> > > > > >
> > > > > > Save the result into this attribute.
> > > > > >
> > > > > > Is there a (vaguely) standard attribute name to use if you want the
> > > > > > contents of the attribute to be used as input to the tag?
> > > > > >
> > > > > > So:
> > > > > >
> > > > > > <str:capitalise var="fred" use="bob"/>
> > > > > >
> > > > > > will take the contents of the variable bob, capitalise it and store it in
> > > > > > the variable fred??
> > > > > >
> > > > > > If there is no standard, any preference on one? 'use'? 'usevar'?
> > > > > >
> > > > > > Bay
> > > > >
> > > > >
> > > > > --
> > > > > To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> > > > > For additional commands, e-mail: <ma...@jakarta.apache.org>
> > > > >
> > > > >
> > > >
> > > >
> > > > --
> > > > To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> > > > For additional commands, e-mail: <ma...@jakarta.apache.org>
> > > >
> > >
> > >
> > > --
> > > To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> > > For additional commands, e-mail: <ma...@jakarta.apache.org>
> > >
> > >
> >
> >
> > --
> > To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> > For additional commands, e-mail: <ma...@jakarta.apache.org>
> >
>
>
> --
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>
>
>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Taglib variables

Posted by Shawn Bayern <ba...@essentially.net>.
Sure - you're essentially implementing your own, slimmed-down expression
language.  Creating a convention for this EL might make sense (e.g.,
'use'), or it might be better to name the attribute based on its intended
use (e.g., 'string').

Shawn

On Fri, 14 Dec 2001 bayard@generationjava.com wrote:

> Sorry. I'm mixing the words variable and attribute too much. Let me try
> for another example.
> 
> <jc:set var="name" value="Unknown"/>
> <str:capitalize var="newname" use="name"/>
> 
> or
> 
> <company:dbWrapper column="PQR_NAME" id="$session:id" var="name"/>
> <str:capitalize var="newname" use="name"/>
> 
> Then, the taglib, rather than using the body of the tag or a 'string'
> attribute, would do:
> 
>     Object target = pageContext.getAttribute( getUse() );
> 
> Is that making any more sense?
> 
> Bay
> 
> On Fri, 14 Dec 2001, Shawn Bayern wrote:
> 
> > I'm not sure I'm following, but it sounds like you're looking to treat the
> > input as potentially a collection of Strings...?  If that's the case, then
> > by analogy with <c:forEach> ('items'), what about calling the attribute
> > 'strings'?
> >
> > Shawn
> >
> > On Fri, 14 Dec 2001 bayard@generationjava.com wrote:
> >
> > > 'value' would be wrong in this case though Shawn. Or at least for how I
> > > was planning to pass information in.
> > >
> > > Using your examples:
> > >
> > > <str:capitalize var="BIG" value="$little"/>
> > >
> > > <str:capitalize var="BIG" use="little"/>    (I removed the $)
> > >
> > > ie) the 'use' attribute I was discussing would say use the variable
> > > 'little' in the pageContext and not, here's a string to act upon.
> > >
> > > While my string example could happily pass strings to act upon in, I am
> > > assuming there are other times when a Collection or array or just some
> > > unknown object would want to be passed in and dealt with accordingly.
> > >
> > > Any ideas?
> > >
> > > Bay
> > >
> > > On Fri, 14 Dec 2001, Shawn Bayern wrote:
> > >
> > > > Bay,
> > > >
> > > > Good question!  My personal sense is that the JSTL EG didn't feel a need
> > > > to standardize on attributes representing 'source,' given that the uses of
> > > > sources vary so widely -- and also given that many tags take multiple
> > > > inputs.  (By contrast, only a few tags output multiple variables.)
> > > >
> > > > I'd say 'value' is probably the most generic one we use, when the input
> > > > variable's purpose is general and there's only a single one.  (For
> > > > instance, <c:expr> uses 'value'.)  But, for instance, JSTL specifically
> > > > uses 'select' instead of 'value' for XPath expressions -- in order to help
> > > > set them apart and make them more noticeable.
> > > >
> > > > I think it's much more important to be consistent when the *use* is the
> > > > same than when it's not.  For instance, in JSTL, source XML documents are
> > > > always accessed by 'source' (unless they're XSLT stylesheets).
> > > >
> > > > To answer your specific question, I'd personally encourage 'value', to
> > > > match <c:expr>.  For instance,
> > > >
> > > >   <str:capitalize var="BIG" value="$little"/>
> > > >
> > > > looks better to me personally than
> > > >
> > > >   <str:capitalize var="BIG" use="$little"/>
> > > >
> > > > ("Use" seems to make more sense to the tag developer than to the user.)
> > > >
> > > > For the 'string' tags, though, 'string' also wouldn't be a bad choice:
> > > >
> > > >   <str:capitalize var="BIG" string="$little"/>
> > > >
> > > > Shawn
> > > >
> > > > On Fri, 14 Dec 2001 bayard@generationjava.com wrote:
> > > >
> > > > > Hopefully a simple question.
> > > > >
> > > > > The JSTL (and others I'm sure) uses the 'var' attriubute to mean:
> > > > >
> > > > > Save the result into this attribute.
> > > > >
> > > > > Is there a (vaguely) standard attribute name to use if you want the
> > > > > contents of the attribute to be used as input to the tag?
> > > > >
> > > > > So:
> > > > >
> > > > > <str:capitalise var="fred" use="bob"/>
> > > > >
> > > > > will take the contents of the variable bob, capitalise it and store it in
> > > > > the variable fred??
> > > > >
> > > > > If there is no standard, any preference on one? 'use'? 'usevar'?
> > > > >
> > > > > Bay
> > > >
> > > >
> > > > --
> > > > To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> > > > For additional commands, e-mail: <ma...@jakarta.apache.org>
> > > >
> > > >
> > >
> > >
> > > --
> > > To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> > > For additional commands, e-mail: <ma...@jakarta.apache.org>
> > >
> >
> >
> > --
> > To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> > For additional commands, e-mail: <ma...@jakarta.apache.org>
> >
> >
> 
> 
> --
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>
> 


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Taglib variables

Posted by ba...@generationjava.com.
Sorry. I'm mixing the words variable and attribute too much. Let me try
for another example.

<jc:set var="name" value="Unknown"/>
<str:capitalize var="newname" use="name"/>

or

<company:dbWrapper column="PQR_NAME" id="$session:id" var="name"/>
<str:capitalize var="newname" use="name"/>

Then, the taglib, rather than using the body of the tag or a 'string'
attribute, would do:

    Object target = pageContext.getAttribute( getUse() );

Is that making any more sense?

Bay

On Fri, 14 Dec 2001, Shawn Bayern wrote:

> I'm not sure I'm following, but it sounds like you're looking to treat the
> input as potentially a collection of Strings...?  If that's the case, then
> by analogy with <c:forEach> ('items'), what about calling the attribute
> 'strings'?
>
> Shawn
>
> On Fri, 14 Dec 2001 bayard@generationjava.com wrote:
>
> > 'value' would be wrong in this case though Shawn. Or at least for how I
> > was planning to pass information in.
> >
> > Using your examples:
> >
> > <str:capitalize var="BIG" value="$little"/>
> >
> > <str:capitalize var="BIG" use="little"/>    (I removed the $)
> >
> > ie) the 'use' attribute I was discussing would say use the variable
> > 'little' in the pageContext and not, here's a string to act upon.
> >
> > While my string example could happily pass strings to act upon in, I am
> > assuming there are other times when a Collection or array or just some
> > unknown object would want to be passed in and dealt with accordingly.
> >
> > Any ideas?
> >
> > Bay
> >
> > On Fri, 14 Dec 2001, Shawn Bayern wrote:
> >
> > > Bay,
> > >
> > > Good question!  My personal sense is that the JSTL EG didn't feel a need
> > > to standardize on attributes representing 'source,' given that the uses of
> > > sources vary so widely -- and also given that many tags take multiple
> > > inputs.  (By contrast, only a few tags output multiple variables.)
> > >
> > > I'd say 'value' is probably the most generic one we use, when the input
> > > variable's purpose is general and there's only a single one.  (For
> > > instance, <c:expr> uses 'value'.)  But, for instance, JSTL specifically
> > > uses 'select' instead of 'value' for XPath expressions -- in order to help
> > > set them apart and make them more noticeable.
> > >
> > > I think it's much more important to be consistent when the *use* is the
> > > same than when it's not.  For instance, in JSTL, source XML documents are
> > > always accessed by 'source' (unless they're XSLT stylesheets).
> > >
> > > To answer your specific question, I'd personally encourage 'value', to
> > > match <c:expr>.  For instance,
> > >
> > >   <str:capitalize var="BIG" value="$little"/>
> > >
> > > looks better to me personally than
> > >
> > >   <str:capitalize var="BIG" use="$little"/>
> > >
> > > ("Use" seems to make more sense to the tag developer than to the user.)
> > >
> > > For the 'string' tags, though, 'string' also wouldn't be a bad choice:
> > >
> > >   <str:capitalize var="BIG" string="$little"/>
> > >
> > > Shawn
> > >
> > > On Fri, 14 Dec 2001 bayard@generationjava.com wrote:
> > >
> > > > Hopefully a simple question.
> > > >
> > > > The JSTL (and others I'm sure) uses the 'var' attriubute to mean:
> > > >
> > > > Save the result into this attribute.
> > > >
> > > > Is there a (vaguely) standard attribute name to use if you want the
> > > > contents of the attribute to be used as input to the tag?
> > > >
> > > > So:
> > > >
> > > > <str:capitalise var="fred" use="bob"/>
> > > >
> > > > will take the contents of the variable bob, capitalise it and store it in
> > > > the variable fred??
> > > >
> > > > If there is no standard, any preference on one? 'use'? 'usevar'?
> > > >
> > > > Bay
> > >
> > >
> > > --
> > > To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> > > For additional commands, e-mail: <ma...@jakarta.apache.org>
> > >
> > >
> >
> >
> > --
> > To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> > For additional commands, e-mail: <ma...@jakarta.apache.org>
> >
>
>
> --
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>
>
>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Taglib variables

Posted by Shawn Bayern <ba...@essentially.net>.
I'm not sure I'm following, but it sounds like you're looking to treat the
input as potentially a collection of Strings...?  If that's the case, then
by analogy with <c:forEach> ('items'), what about calling the attribute
'strings'?

Shawn

On Fri, 14 Dec 2001 bayard@generationjava.com wrote:

> 'value' would be wrong in this case though Shawn. Or at least for how I
> was planning to pass information in.
> 
> Using your examples:
> 
> <str:capitalize var="BIG" value="$little"/>
> 
> <str:capitalize var="BIG" use="little"/>    (I removed the $)
> 
> ie) the 'use' attribute I was discussing would say use the variable
> 'little' in the pageContext and not, here's a string to act upon.
> 
> While my string example could happily pass strings to act upon in, I am
> assuming there are other times when a Collection or array or just some
> unknown object would want to be passed in and dealt with accordingly.
> 
> Any ideas?
> 
> Bay
> 
> On Fri, 14 Dec 2001, Shawn Bayern wrote:
> 
> > Bay,
> >
> > Good question!  My personal sense is that the JSTL EG didn't feel a need
> > to standardize on attributes representing 'source,' given that the uses of
> > sources vary so widely -- and also given that many tags take multiple
> > inputs.  (By contrast, only a few tags output multiple variables.)
> >
> > I'd say 'value' is probably the most generic one we use, when the input
> > variable's purpose is general and there's only a single one.  (For
> > instance, <c:expr> uses 'value'.)  But, for instance, JSTL specifically
> > uses 'select' instead of 'value' for XPath expressions -- in order to help
> > set them apart and make them more noticeable.
> >
> > I think it's much more important to be consistent when the *use* is the
> > same than when it's not.  For instance, in JSTL, source XML documents are
> > always accessed by 'source' (unless they're XSLT stylesheets).
> >
> > To answer your specific question, I'd personally encourage 'value', to
> > match <c:expr>.  For instance,
> >
> >   <str:capitalize var="BIG" value="$little"/>
> >
> > looks better to me personally than
> >
> >   <str:capitalize var="BIG" use="$little"/>
> >
> > ("Use" seems to make more sense to the tag developer than to the user.)
> >
> > For the 'string' tags, though, 'string' also wouldn't be a bad choice:
> >
> >   <str:capitalize var="BIG" string="$little"/>
> >
> > Shawn
> >
> > On Fri, 14 Dec 2001 bayard@generationjava.com wrote:
> >
> > > Hopefully a simple question.
> > >
> > > The JSTL (and others I'm sure) uses the 'var' attriubute to mean:
> > >
> > > Save the result into this attribute.
> > >
> > > Is there a (vaguely) standard attribute name to use if you want the
> > > contents of the attribute to be used as input to the tag?
> > >
> > > So:
> > >
> > > <str:capitalise var="fred" use="bob"/>
> > >
> > > will take the contents of the variable bob, capitalise it and store it in
> > > the variable fred??
> > >
> > > If there is no standard, any preference on one? 'use'? 'usevar'?
> > >
> > > Bay
> >
> >
> > --
> > To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> > For additional commands, e-mail: <ma...@jakarta.apache.org>
> >
> >
> 
> 
> --
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>
> 


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Taglib variables

Posted by ba...@generationjava.com.
'value' would be wrong in this case though Shawn. Or at least for how I
was planning to pass information in.

Using your examples:

<str:capitalize var="BIG" value="$little"/>

<str:capitalize var="BIG" use="little"/>    (I removed the $)

ie) the 'use' attribute I was discussing would say use the variable
'little' in the pageContext and not, here's a string to act upon.

While my string example could happily pass strings to act upon in, I am
assuming there are other times when a Collection or array or just some
unknown object would want to be passed in and dealt with accordingly.

Any ideas?

Bay

On Fri, 14 Dec 2001, Shawn Bayern wrote:

> Bay,
>
> Good question!  My personal sense is that the JSTL EG didn't feel a need
> to standardize on attributes representing 'source,' given that the uses of
> sources vary so widely -- and also given that many tags take multiple
> inputs.  (By contrast, only a few tags output multiple variables.)
>
> I'd say 'value' is probably the most generic one we use, when the input
> variable's purpose is general and there's only a single one.  (For
> instance, <c:expr> uses 'value'.)  But, for instance, JSTL specifically
> uses 'select' instead of 'value' for XPath expressions -- in order to help
> set them apart and make them more noticeable.
>
> I think it's much more important to be consistent when the *use* is the
> same than when it's not.  For instance, in JSTL, source XML documents are
> always accessed by 'source' (unless they're XSLT stylesheets).
>
> To answer your specific question, I'd personally encourage 'value', to
> match <c:expr>.  For instance,
>
>   <str:capitalize var="BIG" value="$little"/>
>
> looks better to me personally than
>
>   <str:capitalize var="BIG" use="$little"/>
>
> ("Use" seems to make more sense to the tag developer than to the user.)
>
> For the 'string' tags, though, 'string' also wouldn't be a bad choice:
>
>   <str:capitalize var="BIG" string="$little"/>
>
> Shawn
>
> On Fri, 14 Dec 2001 bayard@generationjava.com wrote:
>
> > Hopefully a simple question.
> >
> > The JSTL (and others I'm sure) uses the 'var' attriubute to mean:
> >
> > Save the result into this attribute.
> >
> > Is there a (vaguely) standard attribute name to use if you want the
> > contents of the attribute to be used as input to the tag?
> >
> > So:
> >
> > <str:capitalise var="fred" use="bob"/>
> >
> > will take the contents of the variable bob, capitalise it and store it in
> > the variable fred??
> >
> > If there is no standard, any preference on one? 'use'? 'usevar'?
> >
> > Bay
>
>
> --
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>
>
>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Taglib variables

Posted by Shawn Bayern <ba...@essentially.net>.
Bay,

Good question!  My personal sense is that the JSTL EG didn't feel a need
to standardize on attributes representing 'source,' given that the uses of
sources vary so widely -- and also given that many tags take multiple
inputs.  (By contrast, only a few tags output multiple variables.)

I'd say 'value' is probably the most generic one we use, when the input
variable's purpose is general and there's only a single one.  (For
instance, <c:expr> uses 'value'.)  But, for instance, JSTL specifically
uses 'select' instead of 'value' for XPath expressions -- in order to help
set them apart and make them more noticeable.

I think it's much more important to be consistent when the *use* is the
same than when it's not.  For instance, in JSTL, source XML documents are
always accessed by 'source' (unless they're XSLT stylesheets).

To answer your specific question, I'd personally encourage 'value', to
match <c:expr>.  For instance,

  <str:capitalize var="BIG" value="$little"/>

looks better to me personally than

  <str:capitalize var="BIG" use="$little"/>

("Use" seems to make more sense to the tag developer than to the user.)

For the 'string' tags, though, 'string' also wouldn't be a bad choice:

  <str:capitalize var="BIG" string="$little"/>

Shawn

On Fri, 14 Dec 2001 bayard@generationjava.com wrote:

> Hopefully a simple question.
> 
> The JSTL (and others I'm sure) uses the 'var' attriubute to mean:
> 
> Save the result into this attribute.
> 
> Is there a (vaguely) standard attribute name to use if you want the
> contents of the attribute to be used as input to the tag?
> 
> So:
> 
> <str:capitalise var="fred" use="bob"/>
> 
> will take the contents of the variable bob, capitalise it and store it in
> the variable fred??
> 
> If there is no standard, any preference on one? 'use'? 'usevar'?
> 
> Bay


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Taglib variables

Posted by ba...@generationjava.com.
Hopefully a simple question.

The JSTL (and others I'm sure) uses the 'var' attriubute to mean:

Save the result into this attribute.

Is there a (vaguely) standard attribute name to use if you want the
contents of the attribute to be used as input to the tag?

So:

<str:capitalise var="fred" use="bob"/>

will take the contents of the variable bob, capitalise it and store it in
the variable fred??

If there is no standard, any preference on one? 'use'? 'usevar'?

Bay




--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Tag Lib Build Script

Posted by Glenn Nielsen <gl...@voyager.apg.more.net>.
The best place to start is by referring to:

http://jakarta.apache.org/taglibs/addtaglib.html

Once you use Ant to create the directory structure and templates for the
new taglib you can look at taglibs like request, response, etc. for examples.

Regards,

Glenn

crazybob@crazybob.org wrote:
> 
> The Jakarta web site suggests referring to established tag libs when building the directory structure and build scripts for a new library.
> 
> There seems to be a lot of differences. Which is a good lib to use as a reference?
> 
> Thanks,
> Bob
> 
> --
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>

-- 
----------------------------------------------------------------------
Glenn Nielsen             glenn@more.net | /* Spelin donut madder    |
MOREnet System Programming               |  * if iz ina coment.      |
Missouri Research and Education Network  |  */                       |
----------------------------------------------------------------------

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Tag Lib Build Script

Posted by Shawn Bayern <ba...@essentially.net>.
Glenn can correct me if I'm wrong, but I believe that the files and
directory structure under 'src/taglib-template' is a good place to start.

Shawn

On Wed, 12 Dec 2001 bayard@generationjava.com wrote:

> I had the same problem looking at them.
> 
> I tended to focus on the random taglib, and on any of the taglibs Glenn
> worked on as he seems to be the one who knows the build system best.
> Foundation was by him, unsure of the others. I think IO was useful too.
> 
> Lastly, I believe String to be up to date, but I could be horribly wrong.
> 
> Bay
> 
> On Wed, 12 Dec 2001 crazybob@crazybob.org wrote:
> 
> > The Jakarta web site suggests referring to established tag libs when building the directory structure and build scripts for a new library.
> >
> > There seems to be a lot of differences. Which is a good lib to use as a reference?
> >
> > Thanks,
> > Bob
> >
> >
> >
> > --
> > To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> > For additional commands, e-mail: <ma...@jakarta.apache.org>
> >
> >
> 
> 
> --
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>
> 


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Tag Lib Build Script

Posted by ba...@generationjava.com.
I had the same problem looking at them.

I tended to focus on the random taglib, and on any of the taglibs Glenn
worked on as he seems to be the one who knows the build system best.
Foundation was by him, unsure of the others. I think IO was useful too.

Lastly, I believe String to be up to date, but I could be horribly wrong.

Bay

On Wed, 12 Dec 2001 crazybob@crazybob.org wrote:

> The Jakarta web site suggests referring to established tag libs when building the directory structure and build scripts for a new library.
>
> There seems to be a lot of differences. Which is a good lib to use as a reference?
>
> Thanks,
> Bob
>
>
>
> --
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>
>
>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Tag Lib Build Script

Posted by cr...@crazybob.org.
The Jakarta web site suggests referring to established tag libs when building the directory structure and build scripts for a new library.

There seems to be a lot of differences. Which is a good lib to use as a reference?

Thanks,
Bob



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>