RE: [struts-el] What's the benefits ?

2003-03-06 Thread Edgar Dollin
The ambiguity of the syntax is disconcerting and is probably why I limit
it's use.  Whenever I use it, it seems like a guess since the rules are so
loose.  Of course I always guess incorrectly which adds to the frustration.
I for one prefer the more complex syntax and the NPE's, since then you have
a clue as to what is going on.

Edgar

> -Original Message-
> From: Craig R. McClanahan [mailto:[EMAIL PROTECTED] 
> Sent: Wednesday, March 05, 2003 8:52 PM
> To: 'Struts Users Mailing List'
> Subject: RE: [struts-el] What's the benefits ?
> 
> 
> 
> 
> > From: alexj [mailto:[EMAIL PROTECTED]
> >
> > I didn't find the benefits of the use of jstl extention.
> >
> > Who can explain me the benefits ?
> 
> > From: p2 - apache <[EMAIL PROTECTED]>
> >
> > Some body don't want to see <%  %>? Just a guess.
> 
> There's lots of advantages to the expression language that 
> Struts-EL uses (copied from JSTL 1.0, and to be embedded 
> everywhere in a JSP page in JSP 2.0).  My favorite feature is 
> independence from the underlying implementation of the 
> properties.  Consider the following expression:
> 
>   ${customer.mailAddress.city}
> 
> This works for all of the following scenarios (as well as 
> some others):
> 
> * "customer" is a bean with a getMailAddress() getter, which in term
>   returns a bean with a getCity() getter.
> 
> * "customer" is a bean where getMailAddress() returns a Map that has
>   (among others) an entry with a key of "city".
> 
> * "customer" is a Map that has a key "mailAddress" whose value is a
>   bean with a getCity() method.
> 
> * "customer" is a Map with a key of "mailAddress" that returns a Map
>   that has a key of "city" ...
> 
> You get the idea?  The business tier developer has a fair 
> amount of freedom in how they implement the beans 
> representing the data required by the view tier -- or even 
> skips implementing them if Maps do the trick. And changing 
> your mind among these choices does not invalidate the syntax 
> of the expression that is embedded in your page.
> 
> The other thing I like about EL expressions is that the 
> syntax is very close to what page authors familiar with 
> JavaScript already understand, so it's natural for them to be 
> able to script with it, without having to know any java at 
> all.  Consider a personnel management app that wants to 
> restrict the display of salary information to managers.  In a 
> JSP 1.2 environment (with JSTL), you could write:
> 
>   
> 
>   
> 
> and have a fair chance that the page author can understand it 
> -- while the corresponding scriptlet version is pretty opaque 
> to a non-programmer:
> 
>   <%
>  if (user.getRole().equals("Manager")) {
>out.println(employee.getSalary());
>  }
>   %>
> 
> to say nothing of the fact that the Java code requires you to 
> expose "user" and "employee" as instance variables in the 
> page class, while the tagged version doesn't.  (And, by the 
> way, you'd better be prepared for NullPointerException errors 
> in the scriptlet, while the expression language deals with 
> them for you.)
> 
> By the way, in a JSP 2.0 environment, this example will get 
> even simpler:
> 
>   
> ${employee.salary}
>   
> 
> because you will be able to use EL expressions anywhere 
> (including template text), not just in tags that understand it.
> 
> Craig McClanahan
> 
> 
> 

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



Re: [struts-el] What's the benefits ?

2003-03-05 Thread alexj
Oh an old topics ;)) I understoud the benefits and I just buy a
book about JSTL.

Thanks for your clear post Craig.

--
Alexandre Jaquet

- Original Message -
From: "Craig R. McClanahan" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Thursday, March 06, 2003 2:51 AM
Subject: RE: [struts-el] What's the benefits ?


>
>
> > From: alexj [mailto:[EMAIL PROTECTED]
> >
> > I didn't find the benefits of the use of jstl extention.
> >
> > Who can explain me the benefits ?
>
> > From: p2 - apache <[EMAIL PROTECTED]>
> >
> > Some body don't want to see <%  %>? Just a guess.
>
> There's lots of advantages to the expression language that Struts-EL uses
> (copied from JSTL 1.0, and to be embedded everywhere in a JSP page in JSP
> 2.0).  My favorite feature is independence from the underlying
> implementation of the properties.  Consider the following expression:
>
>   ${customer.mailAddress.city}
>
> This works for all of the following scenarios (as well as some others):
>
> * "customer" is a bean with a getMailAddress() getter, which in term
>   returns a bean with a getCity() getter.
>
> * "customer" is a bean where getMailAddress() returns a Map that has
>   (among others) an entry with a key of "city".
>
> * "customer" is a Map that has a key "mailAddress" whose value is a
>   bean with a getCity() method.
>
> * "customer" is a Map with a key of "mailAddress" that returns a Map
>   that has a key of "city" ...
>
> You get the idea?  The business tier developer has a fair amount of
> freedom in how they implement the beans representing the data required by
> the view tier -- or even skips implementing them if Maps do the trick.
> And changing your mind among these choices does not invalidate the syntax
> of the expression that is embedded in your page.
>
> The other thing I like about EL expressions is that the syntax is very
> close to what page authors familiar with JavaScript already understand, so
> it's natural for them to be able to script with it, without having to know
> any java at all.  Consider a personnel management app that wants to
> restrict the display of salary information to managers.  In a JSP 1.2
> environment (with JSTL), you could write:
>
>   
> 
>   
>
> and have a fair chance that the page author can understand it -- while the
> corresponding scriptlet version is pretty opaque to a non-programmer:
>
>   <%
>  if (user.getRole().equals("Manager")) {
>out.println(employee.getSalary());
>  }
>   %>
>
> to say nothing of the fact that the Java code requires you to expose
> "user" and "employee" as instance variables in the page class, while the
> tagged version doesn't.  (And, by the way, you'd better be prepared for
> NullPointerException errors in the scriptlet, while the expression
> language deals with them for you.)
>
> By the way, in a JSP 2.0 environment, this example will get even simpler:
>
>   
> ${employee.salary}
>   
>
> because you will be able to use EL expressions anywhere (including
> template text), not just in tags that understand it.
>
> Craig McClanahan
>
>
>
> -
> 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: [struts-el] What's the benefits ?

2003-03-05 Thread Craig R. McClanahan


> From: alexj [mailto:[EMAIL PROTECTED]
>
> I didn't find the benefits of the use of jstl extention.
>
> Who can explain me the benefits ?

> From: p2 - apache <[EMAIL PROTECTED]>
>
> Some body don't want to see <%  %>? Just a guess.

There's lots of advantages to the expression language that Struts-EL uses
(copied from JSTL 1.0, and to be embedded everywhere in a JSP page in JSP
2.0).  My favorite feature is independence from the underlying
implementation of the properties.  Consider the following expression:

  ${customer.mailAddress.city}

This works for all of the following scenarios (as well as some others):

* "customer" is a bean with a getMailAddress() getter, which in term
  returns a bean with a getCity() getter.

* "customer" is a bean where getMailAddress() returns a Map that has
  (among others) an entry with a key of "city".

* "customer" is a Map that has a key "mailAddress" whose value is a
  bean with a getCity() method.

* "customer" is a Map with a key of "mailAddress" that returns a Map
  that has a key of "city" ...

You get the idea?  The business tier developer has a fair amount of
freedom in how they implement the beans representing the data required by
the view tier -- or even skips implementing them if Maps do the trick.
And changing your mind among these choices does not invalidate the syntax
of the expression that is embedded in your page.

The other thing I like about EL expressions is that the syntax is very
close to what page authors familiar with JavaScript already understand, so
it's natural for them to be able to script with it, without having to know
any java at all.  Consider a personnel management app that wants to
restrict the display of salary information to managers.  In a JSP 1.2
environment (with JSTL), you could write:

  

  

and have a fair chance that the page author can understand it -- while the
corresponding scriptlet version is pretty opaque to a non-programmer:

  <%
 if (user.getRole().equals("Manager")) {
   out.println(employee.getSalary());
 }
  %>

to say nothing of the fact that the Java code requires you to expose
"user" and "employee" as instance variables in the page class, while the
tagged version doesn't.  (And, by the way, you'd better be prepared for
NullPointerException errors in the scriptlet, while the expression
language deals with them for you.)

By the way, in a JSP 2.0 environment, this example will get even simpler:

  
${employee.salary}
  

because you will be able to use EL expressions anywhere (including
template text), not just in tags that understand it.

Craig McClanahan



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



RE: [struts-el] What's the benefits ?

2003-03-03 Thread p2 - apache


Some body don't want to see <%  %>? Just a guess.


-Original Message-
From: alexj [mailto:[EMAIL PROTECTED] 
Sent: February 28, 2003 6:34 PM
To: Struts Users Mailing List
Subject: [struts-el] What's the benefits ?

I didn't find the benefits of the use of jstl extention.

Who can explain me the benefits ? 

--
Alexandre Jaquet




-
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: [struts-el] What's the benefits ?

2003-02-28 Thread Karr, David
And that "before" example wasn't even using scriptlets, which makes it
even harder to read and follow (especially for HTML designers).

> -Original Message-
> From: alexj [mailto:[EMAIL PROTECTED]
> Sent: Friday, February 28, 2003 3:55 PM
> To: Struts Users Mailing List
> Subject: Re: [struts-el] What's the benefits ?
> 
> yep it's more clearer you rigth ;)
> 
> --
> Alexandre Jaquet
> - Original Message -
> From: "John Espey" <[EMAIL PROTECTED]>
> To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
> Sent: Saturday, March 01, 2003 12:49 AM
> Subject: RE: [struts-el] What's the benefits ?
> 
> 
> > here is a simple example:
> >
> > 
> > 
> > 
> > There are no items to be evaluated..
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> >
> > as opposed to:
> >
> >   
> > 
> >There are no items to be evaluated..
> > 
> > 
> >   
> >  
> >   
> > 
> >  
> >
> > it seems easier to me, do you agree?  (I may be falsely sold on a
"new"
> > technology, just curious.)
> >
> > > -Original Message-
> > > From: alexj [mailto:[EMAIL PROTECTED]
> > > Sent: Friday, February 28, 2003 6:34 PM
> > > To: Struts Users Mailing List
> > > Subject: [struts-el] What's the benefits ?
> > >
> > >
> > > I didn't find the benefits of the use of jstl extention.
> > >
> > > Who can explain me the benefits ?
> > >
> > > --
> > > Alexandre Jaquet
> > >
> > >
> > >
> > >
> > >
-
> > > 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: [struts-el] What's the benefits ?

2003-02-28 Thread Vic Cekvenich
Its worth reading to get EL. I preferred "Core JSTL" by Geary.

alexj wrote:
I will read JSTL in Action to have a better knowledege of JSTL.

--
Alexandre Jaquet
- Original Message -
From: "alexj" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Saturday, March 01, 2003 12:49 AM
Subject: Re: [struts-el] What's the benefits ?


I've read a bit but I can't find the difference between jstl and scriplet.
Maybe I've to read more about JSTL.
--
Alexandre Jaquet
- Original Message -
From: "Karr, David" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Saturday, March 01, 2003 12:39 AM
Subject: RE: [struts-el] What's the benefits ?


-Original Message-
From: alexj [mailto:[EMAIL PROTECTED]
Sent: Friday, February 28, 2003 3:34 PM
To: Struts Users Mailing List
Subject: [struts-el] What's the benefits ?
I didn't find the benefits of the use of jstl extention.

Who can explain me the benefits ?
You would be well-advised to read the JSTL specification to get a good
feel for that.  Section 1.1, titled "Goals" provides a reasonably
summary of this.
-
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: [struts-el] What's the benefits ?

2003-02-28 Thread alexj
yep it's more clearer you rigth ;) 

--
Alexandre Jaquet
- Original Message - 
From: "John Espey" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Saturday, March 01, 2003 12:49 AM
Subject: RE: [struts-el] What's the benefits ?


> here is a simple example:
> 
> 
> 
> 
> There are no items to be evaluated..
> 
> 
> 
> 
> 
> 
> 
> 
> as opposed to:
> 
>   
> 
>There are no items to be evaluated..
> 
> 
>   
>  
>   
> 
>  
> 
> it seems easier to me, do you agree?  (I may be falsely sold on a "new"
> technology, just curious.)
> 
> > -Original Message-
> > From: alexj [mailto:[EMAIL PROTECTED]
> > Sent: Friday, February 28, 2003 6:34 PM
> > To: Struts Users Mailing List
> > Subject: [struts-el] What's the benefits ?
> >
> >
> > I didn't find the benefits of the use of jstl extention.
> >
> > Who can explain me the benefits ?
> >
> > --
> > Alexandre Jaquet
> >
> >
> >
> >
> > -
> > 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: [struts-el] What's the benefits ?

2003-02-28 Thread alexj
I will read JSTL in Action to have a better knowledege of JSTL.

--
Alexandre Jaquet

- Original Message -
From: "alexj" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Saturday, March 01, 2003 12:49 AM
Subject: Re: [struts-el] What's the benefits ?


> I've read a bit but I can't find the difference between jstl and scriplet.
> Maybe I've to read more about JSTL.
>
> --
> Alexandre Jaquet
>
> - Original Message -
> From: "Karr, David" <[EMAIL PROTECTED]>
> To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
> Sent: Saturday, March 01, 2003 12:39 AM
> Subject: RE: [struts-el] What's the benefits ?
>
>
> > -Original Message-
> > From: alexj [mailto:[EMAIL PROTECTED]
> > Sent: Friday, February 28, 2003 3:34 PM
> > To: Struts Users Mailing List
> > Subject: [struts-el] What's the benefits ?
> >
> > I didn't find the benefits of the use of jstl extention.
> >
> > Who can explain me the benefits ?
>
> You would be well-advised to read the JSTL specification to get a good
> feel for that.  Section 1.1, titled "Goals" provides a reasonably
> summary of this.
>
>
> -
> 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: [struts-el] What's the benefits ?

2003-02-28 Thread John Espey
here is a simple example:




There are no items to be evaluated……








as opposed to:

  

   There are no items to be evaluated….


  
 
  

 

it seems easier to me, do you agree?  (I may be falsely sold on a "new"
technology, just curious.)

> -Original Message-
> From: alexj [mailto:[EMAIL PROTECTED]
> Sent: Friday, February 28, 2003 6:34 PM
> To: Struts Users Mailing List
> Subject: [struts-el] What's the benefits ?
>
>
> I didn't find the benefits of the use of jstl extention.
>
> Who can explain me the benefits ?
>
> --
> Alexandre Jaquet
>
>
>
>
> -
> 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: [struts-el] What's the benefits ?

2003-02-28 Thread alexj
I've read a bit but I can't find the difference between jstl and scriplet.
Maybe I've to read more about JSTL.

--
Alexandre Jaquet

- Original Message - 
From: "Karr, David" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Saturday, March 01, 2003 12:39 AM
Subject: RE: [struts-el] What's the benefits ?


> -Original Message-
> From: alexj [mailto:[EMAIL PROTECTED]
> Sent: Friday, February 28, 2003 3:34 PM
> To: Struts Users Mailing List
> Subject: [struts-el] What's the benefits ?
> 
> I didn't find the benefits of the use of jstl extention.
> 
> Who can explain me the benefits ?

You would be well-advised to read the JSTL specification to get a good
feel for that.  Section 1.1, titled "Goals" provides a reasonably
summary of this.


-
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: [struts-el] What's the benefits ?

2003-02-28 Thread Karr, David
> -Original Message-
> From: alexj [mailto:[EMAIL PROTECTED]
> Sent: Friday, February 28, 2003 3:34 PM
> To: Struts Users Mailing List
> Subject: [struts-el] What's the benefits ?
> 
> I didn't find the benefits of the use of jstl extention.
> 
> Who can explain me the benefits ?

You would be well-advised to read the JSTL specification to get a good
feel for that.  Section 1.1, titled "Goals" provides a reasonably
summary of this.


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