You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Aaron Kaminsky <aa...@adaptiveplanning.com> on 2007/11/02 18:05:56 UTC

[Tap 4.1.3] multiple ognl evaluation problem (was Re: [Tap 4.1.2] Problem with repeated calls to an If component)

Hi all,

I am on Tap 4.1.3 (using the released binary) and I am also experiencing 
this behavior.  I cannot find any documentation on this situation or a 
workaround other than Jesse's comments in this thread.  Can someone 
point me to more information on how to work around this multiple ognl 
evaluation?  I am migrating a big application from Tap3 and I have lots 
of legacy code that is currently broken because of this behavior.

Thank you,
Aaron

Jesse Kuhnert wrote:
> It's something that will happen to all ognl expressions for the next 
> week or
> two.  After that they will be resolved as per normal in development 
> mode and
> jit'ed in production.
>
> On 5/17/07, Daniel Jue <te...@gmail.com> wrote:
>>
>> Jesse, I stepped away from the computer for a bit, and I had just now
>> submitted the JIRA before updating this conversation.
>>
>> https://issues.apache.org/jira/browse/TAPESTRY-1477
>>
>> I am happy to know it is something that happens on purpose, and for
>> developmental issues.  I would hate to have my DAO's get called 3
>> times in production though, so if similar ensurances are left in, I
>> hope there would be a way to turn it off via a flag, etc.
>>
>> Does this "ensuring" feature only apply to IF components, or to others
>> as well?  (i.e. are expressions for other components being evaluated
>> multiple times?)  I have one dynamic form component that can make use
>> of up to 40 other core components based on multiple if/else
>> components.
>>
>> I also feel assured now that this isn't some ill procedure that would
>> potentially break something down the line.
>>
>> Daniel
>>
>> On 5/17/07, Jesse Kuhnert <jk...@gmail.com> wrote:
>> > No need for JIRA issues - I know exactly why it's doing it and
>> intentionally
>> > have it running this way.
>> >
>> > Unfortunately it's the only sane way I know to make sure 4.1.2 is
>> > releasable.  There's no actual need for OGNL expressions to be 
>> compiled
>> in
>> > dev mode but otherwise I'd have no way of ensuring that your happily
>> > developed app didn't work quite the same way in production. 
>> ...Would you
>> > rather be annoyed for another week or two until the release or get a
>> phone
>> > call at 2am that the app is blowing up and wtf have you done we're
>> totally
>> > screwed? =p
>> >
>> > On 5/17/07, Andreas Andreou <an...@di.uoa.gr> wrote:
>> > >
>> > > Add a JIRA please.
>> > > At least since 4.1.2-20070501.233137-64, i can see the first If
>> getting
>> > > called 3 times!
>> > > And it's probably the first @If after an app reset that gets 
>> evaluated
>> 3
>> > > times and not
>> > > the first @If of a page.
>> > >
>> > > An old 4.1.2-20070215.051249-15 worked correctly, i cant test other
>> (in
>> > > between)
>> > > versions right now due to dependencies incompatibilities.
>> > >
>> > >
>> > >
>> > > On 5/17/07, Daniel Jue <te...@gmail.com> wrote:
>> > > >
>> > > > Ugh.  This is a big pain now.  I have a huge dynamic form that has
>> > > > lots of IFs, and I can see the same queries being called 3 
>> times or
>> > > > more.  =(
>> > > > Everything still works, it's just about 3 times slower.
>> > > >
>> > > > If anyone has solved this problem please let me know!
>> > > >
>> > > > On 5/17/07, Daniel Jue <te...@gmail.com> wrote:
>> > > > > Here is another example when more than one IF component is used.
>> > > > >
>> > > > > It seems the conditional for the first IF gets called 3 times,
>> then
>> > > > > the others just get called once.
>> > > > >
>> > > > > plain.java:
>> > > > >
>> > > > > package com.phy6.app;
>> > > > >
>> > > > > import org.apache.tapestry.IComponent;
>> > > > > import org.apache.tapestry.annotations.Component;
>> > > > > import org.apache.tapestry.annotations.InitialValue;
>> > > > > import org.apache.tapestry.html.BasePage;
>> > > > >
>> > > > > public abstract class plain extends BasePage {
>> > > > >
>> > > > >         public boolean getDoStuff() {
>> > > > >                 this.setNumber(this.getNumber() + 1);
>> > > > >                 System.out.println("plain: getDoStuff() " +
>> > > > this.getNumber());
>> > > > >                 return false;
>> > > > >         }
>> > > > >
>> > > > >         @Component(type = "If", id = "ifXYZ", bindings = {
>> > > > "condition=getDoStuff()" })
>> > > > >         public abstract IComponent getIfXYZ();
>> > > > >
>> > > > >         @Component(type = "If", id = "ifABC", bindings = {
>> > > > "condition=getDoStuff()" })
>> > > > >         public abstract IComponent getIfABC();
>> > > > >
>> > > > >         @Component(type = "If", id = "ifDEF", bindings = {
>> > > > "condition=getDoStuff()" })
>> > > > >         public abstract IComponent getIfDEF();
>> > > > >
>> > > > >         @Component(type = "If", id = "ifGHI", bindings = {
>> > > > "condition=getDoStuff()" })
>> > > > >         public abstract IComponent getIfGHI();
>> > > > >
>> > > > >         @InitialValue("0")
>> > > > >         public abstract int getNumber();
>> > > > >
>> > > > >         @Component(type = "Insert", id = "wtfisgoingon", 
>> bindings
>> = {
>> > > > > "value=getNumber()" })
>> > > > >         public abstract IComponent getWTFisgoingon();
>> > > > >
>> > > > >         public abstract void setNumber(int n);
>> > > > > }
>> > > > >
>> > > > >
>> > > > >
>> > > > > plain.html
>> > > > >
>> > > > > <html>
>> > > > > <body>
>> > > > > <span jwcid="ifXYZ">Hi XYZ</span>
>> > > > > <span jwcid="ifABC">Hi ABC</span>
>> > > > > <span jwcid="ifDEF">Hi DEF</span>
>> > > > > <span jwcid="ifGHI">Hi GHI</span>
>> > > > > <span jwcid="wtfisgoingon" />
>> > > > > </body>
>> > > > > </html>
>> > > > >
>> > > > >
>> > > > > plain.page is an empty page spec.
>> > > > >
>> > > > > Output:
>> > > > > INFO: Server startup in 3645 ms
>> > > > > plain: getDoStuff() 1
>> > > > > plain: getDoStuff() 2
>> > > > > plain: getDoStuff() 3
>> > > > > plain: getDoStuff() 4
>> > > > > plain: getDoStuff() 5
>> > > > > plain: getDoStuff() 6
>> > > > >
>> > > >
>> > > >
>> ---------------------------------------------------------------------
>> > > > To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> > > > For additional commands, e-mail: users-help@tapestry.apache.org
>> > > >
>> > > >
>> > >
>> > >
>> > > --
>> > > Andreas Andreou - andyhot@apache.org - http://andyhot.di.uoa.gr
>> > > Tapestry / Tacos developer
>> > > Open Source / JEE Consulting
>> > >
>> >
>> >
>> >
>> > --
>> > Jesse Kuhnert
>> > Tapestry/Dojo team member/developer
>> >
>> > Open source based consulting work centered around
>> > dojo/tapestry/tacos/hivemind. http://blog.opencomponentry.com
>> >
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: users-help@tapestry.apache.org
>>
>>
>
>


-- 
See how easy it can be to move beyond spreadsheets for budgeting, 
forecasting and reporting! Try Adaptive Planning now: Trial Enterprise 
Edition | Use Free Express Edition

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org