use OGNL to automatically look in the session?

2008-06-24 Thread Brad A Cupit
I have an object that I need to access in a JSP, and the object has a getter on my Action. When the page is initially viewed the object is retrieved off the Value Stack, but if the user is redirected back to the page (due to validation errors) the value comes from the session. When using EL things

Re: use OGNL to automatically look in the session?

2008-06-24 Thread Dave Newton
JSP EL? It checks JEE scopes first then the stack due to S2's custom request doohickey. Dave --- On Tue, 6/24/08, Brad A Cupit <[EMAIL PROTECTED]> wrote: > From: Brad A Cupit <[EMAIL PROTECTED]> > Subject: use OGNL to automatically look in the session? > To: "Str

Re: use OGNL to automatically look in the session?

2008-06-24 Thread Musachy Barroso
"#attr" does something similar: http://struts.apache.org/2.x/docs/ognl.html musachy On Tue, Jun 24, 2008 at 5:51 PM, Brad A Cupit <[EMAIL PROTECTED]> wrote: > I have an object that I need to access in a JSP, and the object has a > getter on my Action. When the page is initially viewed the object

RE: use OGNL to automatically look in the session?

2008-06-24 Thread Brad A Cupit
Musachy Barroso wrote: > "#attr" does something similar: right, but it's kind of yucky in the sense that each of these objects needs a block like this: and then I change use of it from: to: I can live with that, but it seems like a step backward. JSP EL could automatically look

Re: use OGNL to automatically look in the session?

2008-06-24 Thread Martin
rtin - Original Message - From: "Brad A Cupit" <[EMAIL PROTECTED]> To: "Struts Users Mailing List" Sent: Tuesday, June 24, 2008 6:19 PM Subject: RE: use OGNL to automatically look in the session? Musachy Barroso wrote: "#attr" does something similar:

RE: use OGNL to automatically look in the session?

2008-06-24 Thread Brad A Cupit
Musachy Barroso wrote: > "#attr" does something similar: oh wow! you gave me the answer and I didn't read it! I incorrectly assumed you were using attr to refer to a property on the value stack. I should have followed the link instead of being arrogant. Sorry! Thanks for the answer Musachy! That

Re: use OGNL to automatically look in the session?

2008-06-24 Thread Chris Pratt
According to http://struts.apache.org/2.0.11.1/docs/ognl-basics.html "Struts 2 places request parameters and request, session, and application attributes on the OGNL stack." So, you'd think you could just request the attribute and it would search the stack for the value, but I agree that I haven't

RE: use OGNL to automatically look in the session?

2008-06-24 Thread Brad A Cupit
Chris Pratt wrote: > #attr doesn't sound like it will work in your case since > it only searches the old four scopes, and never searches > the value stack. After I figured out that Musachy had given me the right answer (and Martin also gave the right answer), I was a little worried that this would

RE: use OGNL to automatically look in the session?

2008-06-25 Thread Brad A Cupit
Brad Cupit wrote: > I'm not sure which order the scopes are checked For anyone who's interested, #attr appears to check scopes in the following order: 1. page / action * 2. request 3. value stack 4. session 5. application * I used to set one value at page scope and one at action scope, and whic