Re: Evaluating BodyContent

2003-03-21 Thread Dave Newton
>  - As I said before, the syntax is compatible with well-formed XML,
>and it's shorter and more convenient for page authors.

No, really, I enjoy typing all the extra. Honest. Really. 

Tragically, my emacs wonder-macro that expanded ${thang} to the
equivalent  will be rendered useless by JSP 2.0. Shoot.

>  - Expressions, unlike Java, are limited in function; they are only
>used to retrieve values from a handful of specific locations, not
>to call open-ended Java code.

Gotcha.

Thanks,
Dave



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Evaluating BodyContent

2003-03-21 Thread Shawn Bayern
On 21 Mar 2003, Dave Newton wrote:

> Hmm, that's true about the well-formed comment. If one of the goals
> (WAS one of the goals?) was to remove scriptlets, though, isn't the
> ${foo} just some syntactic sugar around a <%=..%>?
> 
> Honestly, I wasn't trying to start anything :D

No, these are all good questions.  One of the goals was indeed to remove
scriptlets.  EL expressions improve upon them in two important ways:

 - As I said before, the syntax is compatible with well-formed XML,
   and it's shorter and more convenient for page authors.

 - Expressions, unlike Java, are limited in function; they are only
   used to retrieve values from a handful of specific locations, not
   to call open-ended Java code.

-- 
Shawn Bayern
"JSTL in Action"   http://www.manning.com/bayern


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Evaluating BodyContent

2003-03-21 Thread Dave Newton
On Fri, 2003-03-21 at 16:52, Shawn Bayern wrote:
> I see what you're saying, but "XML-looking" is vague and not particularly
> a target.  The advantage of ${foo} to <%= foo %> is that it can be used in
> the middle of otherwise well-formed XML documents; JSP continues to
> provide an XML syntax.  In fact, ${foo} is more compatible with XML than
>  in cases where you want to use the variable in
> another tag.

Hmm, that's true about the well-formed comment. If one of the goals (WAS
one of the goals?) was to remove scriptlets, though, isn't the ${foo}
just some syntactic sugar around a <%=..%>?

Honestly, I wasn't trying to start anything :D

Dave



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Evaluating BodyContent

2003-03-21 Thread Shawn Bayern
On 21 Mar 2003, Dave Newton wrote:

> I guess my curiosity just comes from the apparent abandonment of the
>  tag in favor of the obviously simpler EL expressions that
> look like previously-existing solutions is all.
> 
> I'm not complaining; it's better from the brevity-standpoint, it's
> just interesting that it moves away from what I thought was one of the
> main points of JSP which was to provide an X/HTML-looking way of
> accessing things put into scope by the back end of things.

I see what you're saying, but "XML-looking" is vague and not particularly
a target.  The advantage of ${foo} to <%= foo %> is that it can be used in
the middle of otherwise well-formed XML documents; JSP continues to
provide an XML syntax.  In fact, ${foo} is more compatible with XML than
 in cases where you want to use the variable in
another tag.

-- 
Shawn Bayern
"JSTL in Action"   http://www.manning.com/bayern


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Evaluating BodyContent

2003-03-21 Thread Dave Newton
> > If I had a tag that created HTML markup would that still be the
> > canonical way to create that markup? In other words is EL the
> > designated way to grab values from various scopes but not for simple
> > variable lookup?
> I'm not sure I understand the question, but one of JSP 2.0's advantages is
> that you can use the EL in your tags without having to write any code
> (just the way you can use rtexprvalues now).  So you'd write
> 
>   

I guess my curiosity just comes from the apparent abandonment of the
 tag in favor of the obviously simpler EL expressions that
look like previously-existing solutions is all.

I'm not complaining; it's better from the brevity-standpoint, it's just
interesting that it moves away from what I thought was one of the main
points of JSP which was to provide an X/HTML-looking way of accessing
things put into scope by the back end of things.

Dave



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Evaluating BodyContent

2003-03-21 Thread Shawn Bayern
On 21 Mar 2003, Dave Newton wrote:

> If I had a tag that created HTML markup would that still be the
> canonical way to create that markup? In other words is EL the
> designated way to grab values from various scopes but not for simple
> variable lookup?

I'm not sure I understand the question, but one of JSP 2.0's advantages is
that you can use the EL in your tags without having to write any code
(just the way you can use rtexprvalues now).  So you'd write

  

-- 
Shawn Bayern
"JSTL in Action"   http://www.manning.com/bayern


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Evaluating BodyContent

2003-03-21 Thread Dave Newton
> The only change is that expressions will be promoted to the level of
> scripting expressions in order to simplify page syntax; the focus hasn't
> changed.  In other words, instead of
> 
>   <%= pageContext.findAttribute("foo") %>
> 
> you'd simply write
> 
>   ${foo}

Right, but I thought the "approved" way to do the first scriptlet was
, so 2.0 is taking away the tag wrapper and
turning EL into a tag replacement, making it look something like
Velocity, rather than the X/HTML-looking way.

If I had a tag that created HTML markup would that still be the
canonical way to create that markup? In other words is EL the designated
way to grab values from various scopes but not for simple variable
lookup?

Dave



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Evaluating BodyContent

2003-03-21 Thread Shawn Bayern
On 21 Mar 2003, Dave Newton wrote:

> So... to me this implies that JSP 2.0 is moving closer to something
> like Velocity and focusing less on custom tags. Is this a correct
> assessment or is there more to the 2.0 custom tags that I don't know
> about? (I admit I haven't read any specs, so feel free to give me a
> hearty RTFM :)
> 
> I thought one of the points of JSP was to keep content/scripting
> looking XML/HTML-ish for the benefit of page designers.

The only change is that expressions will be promoted to the level of
scripting expressions in order to simplify page syntax; the focus hasn't
changed.  In other words, instead of

  <%= pageContext.findAttribute("foo") %>

you'd simply write

  ${foo}

in JSP 2.0.

-- 
Shawn Bayern
"JSTL in Action"   http://www.manning.com/bayern


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Evaluating BodyContent

2003-03-21 Thread Dave Newton
On Fri, 2003-03-21 at 11:08, Shawn Bayern wrote:
> JSP 2.0 (for which standard Tomcat 5.0 is a compliant container) shifts
> the responsibility of evaluating EL expressions to the container, not
> individual tag handlers.  If you're writing an application for JSP 1.2,
> you could theoretically use our ExpressionEvaluatorManager to parse
> expressions from anywhere, including BodyContent; simply ignore the
> arguments associated with tag attributes.
> 
> Note that without JSP 2.0's support, retrieving expressions from
> BodyContent and parsing them at doEndTag() (or some other fixed point) can
> be extraordinarily confusing to users.  Consider the following situation:
> 
>  
>${a}
>
>  
> 
> The user will probably expect ${a} to evaluate to its original value, but
> if the tag's only opportunity to read and parse the content comes within
> doEndTag(), ${a}'s evaluation will be affected by the  that occurs
> *after* its presence in the page.

So... to me this implies that JSP 2.0 is moving closer to something like
Velocity and focusing less on custom tags. Is this a correct assessment
or is there more to the 2.0 custom tags that I don't know about? (I
admit I haven't read any specs, so feel free to give me a hearty RTFM :)

I thought one of the points of JSP was to keep content/scripting looking
XML/HTML-ish for the benefit of page designers.

Dave



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



about return tag

2003-03-21 Thread Kishi Mikio
Hi all,
I ask the question which I wrote before, once again.


  
  <% if (true) return; %>


In above fmt:bundle usage case,
I want to print out "test1", but not print out
So, to print out "test1", I want to create "return tag".
But, I can't think of a good method.
It is difficult to use PageContest#popBody() and pushBody().
Please tell me a good method of creating return tag.

Sincerely,

Mikio Kishi.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Evaluating BodyContent

2003-03-21 Thread James Smith
I am using Tomcat 4.1.18 right now, so for the time being I'll just send
null for the attribute variables into the ExpressionEvaluatorManager.
Thanks Shawn and Tim (and the taglibs-user community),

James Smith
Developer, Treistman Center
College of Fine Arts, University of Arizona

- Original Message -
From: "Shawn Bayern" <[EMAIL PROTECTED]>
To: "Tag Libraries Users List" <[EMAIL PROTECTED]>
Sent: Friday, March 21, 2003 9:08 AM
Subject: Re: Evaluating BodyContent


> JSP 2.0 (for which standard Tomcat 5.0 is a compliant container) shifts
> the responsibility of evaluating EL expressions to the container, not
> individual tag handlers.  If you're writing an application for JSP 1.2,
> you could theoretically use our ExpressionEvaluatorManager to parse
> expressions from anywhere, including BodyContent; simply ignore the
> arguments associated with tag attributes.
>
> Note that without JSP 2.0's support, retrieving expressions from
> BodyContent and parsing them at doEndTag() (or some other fixed point) can
> be extraordinarily confusing to users.  Consider the following situation:
>
>  
>${a}
>
>  
>
> The user will probably expect ${a} to evaluate to its original value, but
> if the tag's only opportunity to read and parse the content comes within
> doEndTag(), ${a}'s evaluation will be affected by the  that occurs
> *after* its presence in the page.
>
> --
> Shawn Bayern
> "JSTL in Action"   http://www.manning.com/bayern
>
> On Fri, 21 Mar 2003, Tim Kettering wrote:
>
> > If I understand correctly, a JSP 2.0 container will let you use EL 2.0
expressions anywhere in the jsp body without having to use the JSTL tags.  I
also believe that Tomcat 5 is a JSP 2.0 container, and that support may
already be there, I have no idea though.  Someone else may be able to answer
that better.
> >
> > -tim
> >
> > On Friday, March 21, 2003, at 10:21AM, James Smith <[EMAIL PROTECTED]
a.edu> wrote:
> >
> > >I'm writing a custom tag where I would like to, if possible, evaluate
the EL
> > >expressions that may be present within the tag's BodyContent.  The
> > >ExpressionEvaluatorManager seems to need EL expressions to be tied to
an
> > >attribute of the tag.  Is it possible to evaluate the BodyContent?  If
so,
> > >how?  If not, will this issue be resolved in JSP 2.0?  Thanks much,
> > >
> > >James Smith
> > >Developer, Treistman Center
> > >College of Fine Arts, University of Arizona
> > >
> > >
> > >-
> > >To unsubscribe, e-mail: [EMAIL PROTECTED]
> > >For additional commands, e-mail: [EMAIL PROTECTED]
> > >
> > >
> > >
> >
> > -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Evaluating BodyContent

2003-03-21 Thread Shawn Bayern
JSP 2.0 (for which standard Tomcat 5.0 is a compliant container) shifts
the responsibility of evaluating EL expressions to the container, not
individual tag handlers.  If you're writing an application for JSP 1.2,
you could theoretically use our ExpressionEvaluatorManager to parse
expressions from anywhere, including BodyContent; simply ignore the
arguments associated with tag attributes.

Note that without JSP 2.0's support, retrieving expressions from
BodyContent and parsing them at doEndTag() (or some other fixed point) can
be extraordinarily confusing to users.  Consider the following situation:

 
   ${a}
   
 

The user will probably expect ${a} to evaluate to its original value, but
if the tag's only opportunity to read and parse the content comes within
doEndTag(), ${a}'s evaluation will be affected by the  that occurs
*after* its presence in the page.

-- 
Shawn Bayern
"JSTL in Action"   http://www.manning.com/bayern

On Fri, 21 Mar 2003, Tim Kettering wrote:

> If I understand correctly, a JSP 2.0 container will let you use EL 2.0 expressions 
> anywhere in the jsp body without having to use the JSTL tags.  I also believe that 
> Tomcat 5 is a JSP 2.0 container, and that support may already be there, I have no 
> idea though.  Someone else may be able to answer that better.
> 
> -tim
> 
> On Friday, March 21, 2003, at 10:21AM, James Smith <[EMAIL PROTECTED]> wrote:
> 
> >I'm writing a custom tag where I would like to, if possible, evaluate the EL
> >expressions that may be present within the tag's BodyContent.  The
> >ExpressionEvaluatorManager seems to need EL expressions to be tied to an
> >attribute of the tag.  Is it possible to evaluate the BodyContent?  If so,
> >how?  If not, will this issue be resolved in JSP 2.0?  Thanks much,
> >
> >James Smith
> >Developer, Treistman Center
> >College of Fine Arts, University of Arizona
> >
> >
> >-
> >To unsubscribe, e-mail: [EMAIL PROTECTED]
> >For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
> >
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Evaluating BodyContent

2003-03-21 Thread Tim Kettering
If I understand correctly, a JSP 2.0 container will let you use EL 2.0 expressions 
anywhere in the jsp body without having to use the JSTL tags.  I also believe that 
Tomcat 5 is a JSP 2.0 container, and that support may already be there, I have no idea 
though.  Someone else may be able to answer that better.

-tim

On Friday, March 21, 2003, at 10:21AM, James Smith <[EMAIL PROTECTED]> wrote:

>I'm writing a custom tag where I would like to, if possible, evaluate the EL
>expressions that may be present within the tag's BodyContent.  The
>ExpressionEvaluatorManager seems to need EL expressions to be tied to an
>attribute of the tag.  Is it possible to evaluate the BodyContent?  If so,
>how?  If not, will this issue be resolved in JSP 2.0?  Thanks much,
>
>James Smith
>Developer, Treistman Center
>College of Fine Arts, University of Arizona
>
>
>-
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Evaluating BodyContent

2003-03-21 Thread James Smith
I'm writing a custom tag where I would like to, if possible, evaluate the EL
expressions that may be present within the tag's BodyContent.  The
ExpressionEvaluatorManager seems to need EL expressions to be tied to an
attribute of the tag.  Is it possible to evaluate the BodyContent?  If so,
how?  If not, will this issue be resolved in JSP 2.0?  Thanks much,

James Smith
Developer, Treistman Center
College of Fine Arts, University of Arizona


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]