Re: Java-JSP data sharing mechanisms

2007-03-23 Thread Ted Husted

On 3/15/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:

Is there a one-stop grid that identifies what each of these symbols
represent and if/when they are even necessary?


If there were, I believe it would be here

* http://struts.apache.org/2.x/docs/ognl.html

I checked WebWork in Action, and there doesn't seem to be one there either.

So, it is something a volunteer could compile and add to the documentation.

I'm sure that once it was available, many of the old WW hands would
peer-review it.

-Ted.

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



Re: Java-JSP data sharing mechanisms

2007-03-15 Thread Dave Newton
--- [EMAIL PROTECTED] wrote:
> When it comes to sharing values between Java and
> JSP, I see the following conventions used
> 
>1. %foo
>2. $foo
>3. #foo
>4. foo
> 
> Is there a one-stop grid that identifies what each
> of these symbols represent and if/when they are 
> even necessary?

I haven't seen one yet, and I'm still a bit fuzzy on
it myself. I (sorta) know the following:

- Action properties do not need escaping and may be
  accessed via their name, like:
  
  
  
  or
  
  
  
- Vars defined in the JSP, like:

  

  

  ...although in this case you could also just say :

  
  
  because  puts each element
  on the top of the stack.
  
- Things that are put on the OGNL stack by the
framework
  are also available to JSTL via ${...}, the "old" JSP
EL,
  so you could say:
  
  ${anActionProperty}
  
  to save time.
  
  It has been noted that some people don't like mixing
  the ELs, but for me this is a big win for JSP
readability.
  
- %{} I *think* is just an OGNL EL escape, but I am
still
  pretty lost when it comes to understand when I
should/need
  to use %{} vs. #{}. I'm pretty sure you always need
it
  around, say, a method call.
  
- You left out @, which to be honest I haven't tried
for
  awhile, so it might have changed, but it let(s) you
access
  static vars/methods.
  
>1. page
>2. request
>3. session
>4. application
> 
> What is the interplay between stashing objects using
> Java code and subsequent retrieval from JSP?

Scoping works the same way; see below.

> Can Java code interact with OGNL?

Yes, the value stack is available to Java code.

> Are things automatically added/removed from the OG?

*Some* things are, like the current Action and maps
representing the "normal" four scopes, so you can
access, say, request-scoped vars via #request.varKey,
application-scoped vars via #application.varKey, etc.

That's all I know so far, and I still find myself
throwing various EL variations in some situations
until the moon is full and the pixies deem me worthy
to run my JSP.

Hmm, hopefully most of the stuff I just wrote is right
:/

d.



 

We won't tell. Get more on shows you hate to love 
(and love to hate): Yahoo! TV's Guilty Pleasures list.
http://tv.yahoo.com/collections/265 

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



Re: Java-JSP data sharing mechanisms

2007-03-15 Thread Martin Gainty
Stan--
From what I can see use of Object Graph Notational Language allows
Regular Expression evaluations plus 
Lambda Expressions evaluations
http://cwiki.apache.org/WW/ognl.html
HTH,
M--
--- 
This e-mail message (including attachments, if any) is intended for the use of 
the individual or entity to which it is addressed and may contain information 
that is privileged, proprietary , confidential and exempt from disclosure. If 
you are not the intended recipient, you are notified that any dissemination, 
distribution or copying of this communication is strictly prohibited.
--- 
Le présent message électronique (y compris les pièces qui y sont annexées, le 
cas échéant) s'adresse au destinataire indiqué et peut contenir des 
renseignements de caractère privé ou confidentiel. Si vous n'êtes pas le 
destinataire de ce document, nous vous signalons qu'il est strictement interdit 
de le diffuser, de le distribuer ou de le reproduire.
- Original Message - 
From: <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" 
Sent: Thursday, March 15, 2007 4:04 PM
Subject: Java-JSP data sharing mechanisms


> When it comes to sharing values between Java and JSP, I see the following
> conventions used
> 
>   1. %foo
>   2. $foo
>   3. #foo
>   4. foo
> 
> Is there a one-stop grid that identifies what each of these symbols
> represent and if/when they are even necessary?  I read about OGNL and how
> prefixing attributes that are to be retrieved from the OG may *not* require
> a special symbol at all.  I understand JSTL and the four scopes
> 
> 
>   1. page
>   2. request
>   3. session
>   4. application
> 
> What is the interplay between stashing objects using Java code and
> subsequent retrieval fromJSP?  Can Java code interact with OGNL?  Are things
> automatically added/removed from the OG?  This is different enough from
> Stuts 1 that it causes confusion.
> 
> -- 
> Scott
> [EMAIL PROTECTED]
>

Java-JSP data sharing mechanisms

2007-03-15 Thread stanlick

When it comes to sharing values between Java and JSP, I see the following
conventions used

  1. %foo
  2. $foo
  3. #foo
  4. foo

Is there a one-stop grid that identifies what each of these symbols
represent and if/when they are even necessary?  I read about OGNL and how
prefixing attributes that are to be retrieved from the OG may *not* require
a special symbol at all.  I understand JSTL and the four scopes


  1. page
  2. request
  3. session
  4. application

What is the interplay between stashing objects using Java code and
subsequent retrieval fromJSP?  Can Java code interact with OGNL?  Are things
automatically added/removed from the OG?  This is different enough from
Stuts 1 that it causes confusion.

--
Scott
[EMAIL PROTECTED]