You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by ZedroS Schwart <ze...@gmail.com> on 2006/02/01 22:13:17 UTC

[NewB] Separating the ValidatorBean from the Page.app

Hi all

I'm playing around the excellent Enjoying Web Development with
Tapestry pdf and I would like to do a variation around the
ValidatorBean.

In the example page 77, the PatronCodeValidator class and the Home
class are in the same folder. I was trying to put the
PatronCodeValidator somewhere else, for example :
<page-specification class="pages.Home">

	<bean name="patronCodeValidator" class="validator.PatronCodeValidator">
		<set name="knownPatrons" value="ognl:knownPatrons"/>
	</bean>
(...)

</page-specification>

However, it doesn't work, I get this error :
"org.apache.hivemind.ApplicationRuntimeException	
Error initializing property knownPatrons of bean 'patronCodeValidator'
(of component Postage): Unable to read OGNL expression '<parsed OGNL
expression>' of $Postage_11@198046[Postage]: $Postage_11.knownPatrons"


SoMy questions are : is it possible to have the Validator in another
package than the one where the page's class is ? If yes, how ?

Thanks in advance

ZedroS

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


Re: [NewB] Separating the ValidatorBean from the Page.app

Posted by ZedroS Schwart <ze...@gmail.com>.
Thanks for your answer Matt. As soon as I have finish my current work on a
Spring/Struts website, I'll happily use your advice :)

Thanks again

ZedroS

On 2/2/06, Mat Gessel <ma...@gmail.com> wrote:
>
> The error indicates that OGNL cannot read the knownPatrons property.
> Make sure you have this property defined in the page. If you want to
> access a property from multiple pages you can define it in a singleton
> and access it statically like:
> ognl:@com.ttdev.postage.KnownPatrons@getInstance()
>
> When you get to chapter 4 you will see a better way of doing this:
> Application State Objects.
>
> -= Mat
>
> On 2/1/06, ZedroS Schwart <ze...@gmail.com> wrote:
> > Hi all
> >
> > I'm playing around the excellent Enjoying Web Development with
> > Tapestry pdf and I would like to do a variation around the
> > ValidatorBean.
> >
> > In the example page 77, the PatronCodeValidator class and the Home
> > class are in the same folder. I was trying to put the
> > PatronCodeValidator somewhere else, for example :
> > <page-specification class="pages.Home">
> >
> >         <bean name="patronCodeValidator" class="
> validator.PatronCodeValidator">
> >                 <set name="knownPatrons" value="ognl:knownPatrons"/>
> >         </bean>
> > (...)
> >
> > </page-specification>
> >
> > However, it doesn't work, I get this error :
> > "org.apache.hivemind.ApplicationRuntimeException
> > Error initializing property knownPatrons of bean 'patronCodeValidator'
> > (of component Postage): Unable to read OGNL expression '<parsed OGNL
> > expression>' of $Postage_11@198046[Postage]: $Postage_11.knownPatrons"
> >
> >
> > SoMy questions are : is it possible to have the Validator in another
> > package than the one where the page's class is ? If yes, how ?
> >
> > Thanks in advance
> >
> > ZedroS
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>
>

Re: [NewB] Separating the ValidatorBean from the Page.app

Posted by Mat Gessel <ma...@gmail.com>.
The error indicates that OGNL cannot read the knownPatrons property.
Make sure you have this property defined in the page. If you want to
access a property from multiple pages you can define it in a singleton
and access it statically like:
ognl:@com.ttdev.postage.KnownPatrons@getInstance()

When you get to chapter 4 you will see a better way of doing this:
Application State Objects.

-= Mat

On 2/1/06, ZedroS Schwart <ze...@gmail.com> wrote:
> Hi all
>
> I'm playing around the excellent Enjoying Web Development with
> Tapestry pdf and I would like to do a variation around the
> ValidatorBean.
>
> In the example page 77, the PatronCodeValidator class and the Home
> class are in the same folder. I was trying to put the
> PatronCodeValidator somewhere else, for example :
> <page-specification class="pages.Home">
>
>         <bean name="patronCodeValidator" class="validator.PatronCodeValidator">
>                 <set name="knownPatrons" value="ognl:knownPatrons"/>
>         </bean>
> (...)
>
> </page-specification>
>
> However, it doesn't work, I get this error :
> "org.apache.hivemind.ApplicationRuntimeException
> Error initializing property knownPatrons of bean 'patronCodeValidator'
> (of component Postage): Unable to read OGNL expression '<parsed OGNL
> expression>' of $Postage_11@198046[Postage]: $Postage_11.knownPatrons"
>
>
> SoMy questions are : is it possible to have the Validator in another
> package than the one where the page's class is ? If yes, how ?
>
> Thanks in advance
>
> ZedroS
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>
>

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