Re: Getting ServletContext inside service

2009-10-30 Thread Benny Law
Hi Stefan,

Try injecting org.apache.tapestry5.services.Context into your service and
use its getInitParameter() method to retrieve your context parameters.

Regards,

Benny Law

On Fri, Oct 30, 2009 at 3:56 PM, Stefan  wrote:

> Hi,
>
> is there a way to get access to the ServletContext inside a service bean?
>
> I like to configure some parameters within the web.xml which i need in some
> services.
> How can i retrieve these parameters?
> Injecting "ApplicationGlobals" does not work.
>
> Where is my mistake?
>
> Thanks in advance.
> Stefan


Re: currentLocale vs persistentLocale

2009-10-30 Thread Gunnar Eketrapp
Hi !

Given these injections ...

@Inject
private PersistentLocale persistentLocale;

@Inject
private Locale currentLocale;

... what should be the value of currentLocale. I.e. after that the
persistent locale has been set, should curentLocale follow?

I will conduct tests tomorrow with a minimal project but the locale handling
in my project is quite fucked up right now and it is driving me crazy.

I assume that it should just be to call persistentLocale.set() in an action
link method and after that things should work. But for me they are not ...

/Gunnar


2009/10/30 Gunnar Eketrapp 

> Hi!
>
> The code below is not PROD ready yet. The first section is to setup input
> fields with label inside them.
> Something that our "designers" seems slick!
>
> The state locale is used it to remember the locale when called from a flash
> menu
> that "discarded" the persistent locale. The flash menu is feeded with
> special pages
> that resets the persitent locale ... and redirects to the actial page.
>
> Shit this seems messy ...
>
> Thanks for the help anyway!
>
> /Gunnar
>
>   @SetupRender
> void setupComponent()
> {
> if (!userExists) {
> username = messages.get("username");
> password = messages.get("password");
> } else {
> username = user.getUsername();
> password = messages.get("password");
> }
>
> language = currentLocale.getLanguage();
>
> log.debug(LOGPRE + "1:
> TellLayout.setupComponent(currentLocale.language=" + language + ")");
> if ((null == state.getLocale()) && (language != null)) {
> state.setLocale(new Locale(language));
> log.debug(LOGPRE + "2: TellLayout.setupComponent(state.locale
> initiated to " + state.getLocale() + ")");
> }
>
> if (!persistentLocale.isSet()) {
> persistentLocale.set(state.getLocale());
> log.debug(LOGPRE + "3:
> TellLayout.setupComponent(persistentLocale.set(" + persistentLocale.get() +
> ")");
> } else {
> log.debug(LOGPRE + "4:
> TellLayout.setupComponent(persistentLocale=" + persistentLocale.get() +
> ")");
> }
>
> // -- Localize account menu texts. --
> createAccountMenu();
>
> }
>
>
> 2009/10/30 cordenier christophe 
>
>> To what corresponds exactly this logs in your rendering scenario ?
>>
>> [DEBUG] components.TellLayout <<< --- TELLGAMING --- >>>: 1:
>> TellLayout.setupComponent(
>> currentLocale.language=sv)
>> [DEBUG] components.TellLayout <<< --- TELLGAMING --- >>>: 4:
>> TellLayout.setupComponent(persistentLocale=en)
>>
>>
>> 2009/10/30 cordenier christophe 
>>
>> > Sorry i have missed
>> >
>> > [DEBUG] AppModule.
>> > ProtectedPageGateKeeper PPGK.path=/en/tellfriends
>> >
>> >
>> > 2009/10/30 Gunnar Eketrapp 
>> >
>> >> Hi!
>> >>
>> >> Well I have read that page over and over ...
>> >>
>> >> I am calling persistentLocale.set() in the action link connected to my
>> >> language selector.
>> >>
>> >> But for some reasons the persistentLocale is not used when rendering
>> 
>> >>
>> >> The page below is rendered in swedish even if the persistentLocale is
>> >> english.
>> >>
>> >> [DEBUG] AppModule.ProtectedPageGateKeeper PPGK.path=/en/tellfriends
>> >> [DEBUG] components.TellLayout <<< --- TELLGAMING --- >>>: 1:
>> >> TellLayout.setupComponent(currentLocale.language=sv)
>> >> [DEBUG] components.TellLayout <<< --- TELLGAMING --- >>>: 4:
>> >> TellLayout.setupComponent(persistentLocale=en)
>> >>
>> >>
>> >> To this I have ...
>> >>
>> >> TellFriends_en.properties
>> >> TellFriends_sv.properties
>> >>
>> >> ... and "sv" is the default language.
>> >>
>> >> /Gunnar
>> >>
>> >> 2009/10/30 cordenier christophe 
>> >>
>> >> > Hi
>> >> >
>> >> > Have a look at 'Changing the Locale' here
>> >> > http://tapestry.apache.org/tapestry5.1/guide/localization.html
>> >> > to check if your are using the good scenario to change locale, since
>> >> > Tapestry 5.1 uses URL to store Local and not a cookie (like in
>> 5.0.18)
>> >> >
>> >> > Christophe.
>> >> >
>> >> > 2009/10/30 Gunnar Eketrapp 
>> >> >
>> >> > > Hi!
>> >> > >
>> >> > > For some reason my pages are rendered accoring to currentLocale and
>> >> not
>> >> > > persistentLocale.
>> >> > >
>> >> > > Is there something I should now?
>> >> > >
>> >> > > Thanks in advance,
>> >> > > Gunnar Eketrapp
>> >> > >
>> >> >
>> >>
>> >>
>> >>
>> >> --
>> >> [Hem: 08-715 59 57, Mobil: 0708-52 62 90]
>> >> Allévägen 2A, 132 42 Saltsjö-Boo
>> >>
>> >
>> >
>>
>
>
>
> --
> [Hem: 08-715 59 57, Mobil: 0708-52 62 90]
> Allévägen 2A, 132 42 Saltsjö-Boo
>



-- 
[Hem: 08-715 59 57, Mobil: 0708-52 62 90]
Allévägen 2A, 132 42 Saltsjö-Boo


Getting ServletContext inside service

2009-10-30 Thread Stefan

Hi,

is there a way to get access to the ServletContext inside a service  
bean?


I like to configure some parameters within the web.xml which i need in  
some services.

How can i retrieve these parameters?
Injecting "ApplicationGlobals" does not work.

Where is my mistake?

Thanks in advance.
Stefan

smime.p7s
Description: S/MIME cryptographic signature


Re: does tapestry support en-us locale?

2009-10-30 Thread Kevin Menard
Hi Jamie,

Did you just modify the i18n property bundles or did you register the
locale with Tapestry as well?

-- 
Kevin



On Fri, Oct 30, 2009 at 2:49 PM, Jamie Counihan
 wrote:
> Hi all,
>
> Quick question about localisation/language translation.
>
> I know tapestry supports different locales i.e. en, fr, de, es etc.
>
> This works fine.
>
> What I would like is to support another english format other than "en" - for
> example "en-us".
>
> However, when I add the properties and change my browser language, the
> default "en" format is used by my web application.
>
> Can you help to answer this simple question?
>
> Many thanks,
> Jamie
>

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



does tapestry support en-us locale?

2009-10-30 Thread Jamie Counihan
Hi all,

Quick question about localisation/language translation.

I know tapestry supports different locales i.e. en, fr, de, es etc.

This works fine.

What I would like is to support another english format other than "en" - for
example "en-us".

However, when I add the properties and change my browser language, the
default "en" format is used by my web application.

Can you help to answer this simple question?

Many thanks,
Jamie


Re: currentLocale vs persistentLocale

2009-10-30 Thread Gunnar Eketrapp
Hi!

The code below is not PROD ready yet. The first section is to setup input
fields with label inside them.
Something that our "designers" seems slick!

The state locale is used it to remember the locale when called from a flash
menu
that "discarded" the persistent locale. The flash menu is feeded with
special pages
that resets the persitent locale ... and redirects to the actial page.

Shit this seems messy ...

Thanks for the help anyway!

/Gunnar

  @SetupRender
void setupComponent()
{
if (!userExists) {
username = messages.get("username");
password = messages.get("password");
} else {
username = user.getUsername();
password = messages.get("password");
}

language = currentLocale.getLanguage();

log.debug(LOGPRE + "1:
TellLayout.setupComponent(currentLocale.language=" + language + ")");
if ((null == state.getLocale()) && (language != null)) {
state.setLocale(new Locale(language));
log.debug(LOGPRE + "2: TellLayout.setupComponent(state.locale
initiated to " + state.getLocale() + ")");
}

if (!persistentLocale.isSet()) {
persistentLocale.set(state.getLocale());
log.debug(LOGPRE + "3:
TellLayout.setupComponent(persistentLocale.set(" + persistentLocale.get() +
")");
} else {
log.debug(LOGPRE + "4:
TellLayout.setupComponent(persistentLocale=" + persistentLocale.get() +
")");
}

// -- Localize account menu texts. --
createAccountMenu();
}


2009/10/30 cordenier christophe 

> To what corresponds exactly this logs in your rendering scenario ?
>
> [DEBUG] components.TellLayout <<< --- TELLGAMING --- >>>: 1:
> TellLayout.setupComponent(
> currentLocale.language=sv)
> [DEBUG] components.TellLayout <<< --- TELLGAMING --- >>>: 4:
> TellLayout.setupComponent(persistentLocale=en)
>
>
> 2009/10/30 cordenier christophe 
>
> > Sorry i have missed
> >
> > [DEBUG] AppModule.
> > ProtectedPageGateKeeper PPGK.path=/en/tellfriends
> >
> >
> > 2009/10/30 Gunnar Eketrapp 
> >
> >> Hi!
> >>
> >> Well I have read that page over and over ...
> >>
> >> I am calling persistentLocale.set() in the action link connected to my
> >> language selector.
> >>
> >> But for some reasons the persistentLocale is not used when rendering
> 
> >>
> >> The page below is rendered in swedish even if the persistentLocale is
> >> english.
> >>
> >> [DEBUG] AppModule.ProtectedPageGateKeeper PPGK.path=/en/tellfriends
> >> [DEBUG] components.TellLayout <<< --- TELLGAMING --- >>>: 1:
> >> TellLayout.setupComponent(currentLocale.language=sv)
> >> [DEBUG] components.TellLayout <<< --- TELLGAMING --- >>>: 4:
> >> TellLayout.setupComponent(persistentLocale=en)
> >>
> >>
> >> To this I have ...
> >>
> >> TellFriends_en.properties
> >> TellFriends_sv.properties
> >>
> >> ... and "sv" is the default language.
> >>
> >> /Gunnar
> >>
> >> 2009/10/30 cordenier christophe 
> >>
> >> > Hi
> >> >
> >> > Have a look at 'Changing the Locale' here
> >> > http://tapestry.apache.org/tapestry5.1/guide/localization.html
> >> > to check if your are using the good scenario to change locale, since
> >> > Tapestry 5.1 uses URL to store Local and not a cookie (like in 5.0.18)
> >> >
> >> > Christophe.
> >> >
> >> > 2009/10/30 Gunnar Eketrapp 
> >> >
> >> > > Hi!
> >> > >
> >> > > For some reason my pages are rendered accoring to currentLocale and
> >> not
> >> > > persistentLocale.
> >> > >
> >> > > Is there something I should now?
> >> > >
> >> > > Thanks in advance,
> >> > > Gunnar Eketrapp
> >> > >
> >> >
> >>
> >>
> >>
> >> --
> >> [Hem: 08-715 59 57, Mobil: 0708-52 62 90]
> >> Allévägen 2A, 132 42 Saltsjö-Boo
> >>
> >
> >
>



-- 
[Hem: 08-715 59 57, Mobil: 0708-52 62 90]
Allévägen 2A, 132 42 Saltsjö-Boo


Re: currentLocale vs persistentLocale

2009-10-30 Thread cordenier christophe
To what corresponds exactly this logs in your rendering scenario ?

[DEBUG] components.TellLayout <<< --- TELLGAMING --- >>>: 1:
TellLayout.setupComponent(
currentLocale.language=sv)
[DEBUG] components.TellLayout <<< --- TELLGAMING --- >>>: 4:
TellLayout.setupComponent(persistentLocale=en)


2009/10/30 cordenier christophe 

> Sorry i have missed
>
> [DEBUG] AppModule.
> ProtectedPageGateKeeper PPGK.path=/en/tellfriends
>
>
> 2009/10/30 Gunnar Eketrapp 
>
>> Hi!
>>
>> Well I have read that page over and over ...
>>
>> I am calling persistentLocale.set() in the action link connected to my
>> language selector.
>>
>> But for some reasons the persistentLocale is not used when rendering 
>>
>> The page below is rendered in swedish even if the persistentLocale is
>> english.
>>
>> [DEBUG] AppModule.ProtectedPageGateKeeper PPGK.path=/en/tellfriends
>> [DEBUG] components.TellLayout <<< --- TELLGAMING --- >>>: 1:
>> TellLayout.setupComponent(currentLocale.language=sv)
>> [DEBUG] components.TellLayout <<< --- TELLGAMING --- >>>: 4:
>> TellLayout.setupComponent(persistentLocale=en)
>>
>>
>> To this I have ...
>>
>> TellFriends_en.properties
>> TellFriends_sv.properties
>>
>> ... and "sv" is the default language.
>>
>> /Gunnar
>>
>> 2009/10/30 cordenier christophe 
>>
>> > Hi
>> >
>> > Have a look at 'Changing the Locale' here
>> > http://tapestry.apache.org/tapestry5.1/guide/localization.html
>> > to check if your are using the good scenario to change locale, since
>> > Tapestry 5.1 uses URL to store Local and not a cookie (like in 5.0.18)
>> >
>> > Christophe.
>> >
>> > 2009/10/30 Gunnar Eketrapp 
>> >
>> > > Hi!
>> > >
>> > > For some reason my pages are rendered accoring to currentLocale and
>> not
>> > > persistentLocale.
>> > >
>> > > Is there something I should now?
>> > >
>> > > Thanks in advance,
>> > > Gunnar Eketrapp
>> > >
>> >
>>
>>
>>
>> --
>> [Hem: 08-715 59 57, Mobil: 0708-52 62 90]
>> Allévägen 2A, 132 42 Saltsjö-Boo
>>
>
>


Re: currentLocale vs persistentLocale

2009-10-30 Thread cordenier christophe
Sorry i have missed

[DEBUG] AppModule.
ProtectedPageGateKeeper PPGK.path=/en/tellfriends


2009/10/30 Gunnar Eketrapp 

> Hi!
>
> Well I have read that page over and over ...
>
> I am calling persistentLocale.set() in the action link connected to my
> language selector.
>
> But for some reasons the persistentLocale is not used when rendering 
>
> The page below is rendered in swedish even if the persistentLocale is
> english.
>
> [DEBUG] AppModule.ProtectedPageGateKeeper PPGK.path=/en/tellfriends
> [DEBUG] components.TellLayout <<< --- TELLGAMING --- >>>: 1:
> TellLayout.setupComponent(currentLocale.language=sv)
> [DEBUG] components.TellLayout <<< --- TELLGAMING --- >>>: 4:
> TellLayout.setupComponent(persistentLocale=en)
>
>
> To this I have ...
>
> TellFriends_en.properties
> TellFriends_sv.properties
>
> ... and "sv" is the default language.
>
> /Gunnar
>
> 2009/10/30 cordenier christophe 
>
> > Hi
> >
> > Have a look at 'Changing the Locale' here
> > http://tapestry.apache.org/tapestry5.1/guide/localization.html
> > to check if your are using the good scenario to change locale, since
> > Tapestry 5.1 uses URL to store Local and not a cookie (like in 5.0.18)
> >
> > Christophe.
> >
> > 2009/10/30 Gunnar Eketrapp 
> >
> > > Hi!
> > >
> > > For some reason my pages are rendered accoring to currentLocale and not
> > > persistentLocale.
> > >
> > > Is there something I should now?
> > >
> > > Thanks in advance,
> > > Gunnar Eketrapp
> > >
> >
>
>
>
> --
> [Hem: 08-715 59 57, Mobil: 0708-52 62 90]
> Allévägen 2A, 132 42 Saltsjö-Boo
>


Re: currentLocale vs persistentLocale

2009-10-30 Thread cordenier christophe
is the locale present in the URL ?

2009/10/30 Gunnar Eketrapp 

> Hi!
>
> Well I have read that page over and over ...
>
> I am calling persistentLocale.set() in the action link connected to my
> language selector.
>
> But for some reasons the persistentLocale is not used when rendering 
>
> The page below is rendered in swedish even if the persistentLocale is
> english.
>
> [DEBUG] AppModule.ProtectedPageGateKeeper PPGK.path=/en/tellfriends
> [DEBUG] components.TellLayout <<< --- TELLGAMING --- >>>: 1:
> TellLayout.setupComponent(currentLocale.language=sv)
> [DEBUG] components.TellLayout <<< --- TELLGAMING --- >>>: 4:
> TellLayout.setupComponent(persistentLocale=en)
>
>
> To this I have ...
>
> TellFriends_en.properties
> TellFriends_sv.properties
>
> ... and "sv" is the default language.
>
> /Gunnar
>
> 2009/10/30 cordenier christophe 
>
> > Hi
> >
> > Have a look at 'Changing the Locale' here
> > http://tapestry.apache.org/tapestry5.1/guide/localization.html
> > to check if your are using the good scenario to change locale, since
> > Tapestry 5.1 uses URL to store Local and not a cookie (like in 5.0.18)
> >
> > Christophe.
> >
> > 2009/10/30 Gunnar Eketrapp 
> >
> > > Hi!
> > >
> > > For some reason my pages are rendered accoring to currentLocale and not
> > > persistentLocale.
> > >
> > > Is there something I should now?
> > >
> > > Thanks in advance,
> > > Gunnar Eketrapp
> > >
> >
>
>
>
> --
> [Hem: 08-715 59 57, Mobil: 0708-52 62 90]
> Allévägen 2A, 132 42 Saltsjö-Boo
>


Re: currentLocale vs persistentLocale

2009-10-30 Thread Gunnar Eketrapp
Hi!

Well I have read that page over and over ...

I am calling persistentLocale.set() in the action link connected to my
language selector.

But for some reasons the persistentLocale is not used when rendering 

The page below is rendered in swedish even if the persistentLocale is
english.

[DEBUG] AppModule.ProtectedPageGateKeeper PPGK.path=/en/tellfriends
[DEBUG] components.TellLayout <<< --- TELLGAMING --- >>>: 1:
TellLayout.setupComponent(currentLocale.language=sv)
[DEBUG] components.TellLayout <<< --- TELLGAMING --- >>>: 4:
TellLayout.setupComponent(persistentLocale=en)


To this I have ...

TellFriends_en.properties
TellFriends_sv.properties

... and "sv" is the default language.

/Gunnar

2009/10/30 cordenier christophe 

> Hi
>
> Have a look at 'Changing the Locale' here
> http://tapestry.apache.org/tapestry5.1/guide/localization.html
> to check if your are using the good scenario to change locale, since
> Tapestry 5.1 uses URL to store Local and not a cookie (like in 5.0.18)
>
> Christophe.
>
> 2009/10/30 Gunnar Eketrapp 
>
> > Hi!
> >
> > For some reason my pages are rendered accoring to currentLocale and not
> > persistentLocale.
> >
> > Is there something I should now?
> >
> > Thanks in advance,
> > Gunnar Eketrapp
> >
>



-- 
[Hem: 08-715 59 57, Mobil: 0708-52 62 90]
Allévägen 2A, 132 42 Saltsjö-Boo


Tapestry 5.1 / Selenium / Session handling

2009-10-30 Thread cordenier christophe
Hi all,

I am trying to build a test case with Selenium
(AbstractIntegrationTestSuite), but it seems that a new session is created
on each request.
I use IE.

Has anyone encounter this problem ?

Thanks in advance,
Christophe.


Re: currentLocale vs persistentLocale

2009-10-30 Thread cordenier christophe
Hi

Have a look at 'Changing the Locale' here
http://tapestry.apache.org/tapestry5.1/guide/localization.html
to check if your are using the good scenario to change locale, since
Tapestry 5.1 uses URL to store Local and not a cookie (like in 5.0.18)

Christophe.

2009/10/30 Gunnar Eketrapp 

> Hi!
>
> For some reason my pages are rendered accoring to currentLocale and not
> persistentLocale.
>
> Is there something I should now?
>
> Thanks in advance,
> Gunnar Eketrapp
>


Re: T5.1.0.5 on JBoss 5.1.0 = no standard components

2009-10-30 Thread Janko Muzykant

thanks for this hint. i tried to adjust ClassPathURLConverter for JB 5.1 but
i'm not really sure what URL should I return to make it all working. this is
how sample incoming url looks like:

vfszip:/Users/janko/jboss-5.1.0.GA/server/myapp/deploy/myapp-ear.ear/myapp-webapp-1.0-SNAPSHOT.war/WEB-INF/classes/org/myapp/web/tapestry/pages/

i may extract the "real" path:

/Users/janko/jboss-5.1.0.GA/server/myapp/tmp/a12x-5le7zb-g1f16qd9-1-g1f17m6c-9i/myapp-webapp-1.0-SNAPSHOT.war/WEB-INF/classes/org/myapp/web/tapestry/pages/

and how should I construct target URL now?

cheers,
m.


Geoff Callender-2 wrote:
> 
> I don't of any a solution to making T5 work with JBoss 5.1.*, but it's  
> fine with 5.0.1 if you follow
> http://wiki.apache.org/tapestry/HowToRunTapestry5OnJBoss5 
> 
> 
> On 30/10/2009, at 11:42 AM, Thiago H. de Paula Figueiredo wrote:
> 
>> It's just a wild guess, but check if the Tapestry JARs are  
>> corrupted. This can cause all sorts of strange behaviour.
>>
>> -- 
>> Thiago H. de Paula Figueiredo
>> Independent Java, Apache Tapestry 5 and Hibernate consultant,  
>> developer, and instructor
>> Owner, software architect and developer, Ars Machina Tecnologia da  
>> Informação Ltda.
>> http://www.arsmachina.com.br
>>
>> -
>> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
>> For additional commands, e-mail: users-h...@tapestry.apache.org
>>
> 
> 
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
> 
> 
> 

-- 
View this message in context: 
http://old.nabble.com/T5.1.0.5-on-JBoss-5.1.0-%3D-no-standard-components-tp26123165p26131277.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


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



Re: Index page is activated for each page request ?

2009-10-30 Thread cordenier christophe
So this is maybe your image 'src' that does not exist and is considered by
Tapestry to be a call to index page :

You can find a similar behavior here :

https://issues.apache.org/jira/browse/TAP5-879



2009/10/30 Gunnar Eketrapp 

> Hi !
>
> When creating a minimal reproduction (not an easy task)  I realized that a
> link in the footer seemed to part of the problem,
>
> It was not tapified and included old links 
> When I commented it out my app started to behave again!
> I.e. not activating the index page for each page reques.
>
>
>
> Thanks for the help
> /Gunnar Ekerapp
>
> 2009/10/30 Gunnar Eketrapp 
>
> > Hi and thanks for the effort!
> >
> > I will try to create a minimal reproduction.
> >
> > /Gunnar
> >
> > 2009/10/30 cordenier christophe 
> >
> > Hi
> >>
> >> I have made a test and cannot reproduce this behaviour, can you send a
> >> sample that reproduces it ?
> >>
> >> Regards,
> >> Christophe.
> >>
> >> 2009/10/30 Gunnar Eketrapp 
> >>
> >> > Hi!
> >> >
> >> > By some reason my index page is activated after each page request.
> >> >
> >> > What have I missed?
> >> >
> >> > Thanks in advance!
> >> > /Gunnar Eketrapp
> >> >
> >>
> >
> >
> >
> > --
> > [Hem: 08-715 59 57, Mobil: 0708-52 62 90]
> > Allévägen 2A, 132 42 Saltsjö-Boo
> >
>
>
>
> --
> [Hem: 08-715 59 57, Mobil: 0708-52 62 90]
> Allévägen 2A, 132 42 Saltsjö-Boo
>


currentLocale vs persistentLocale

2009-10-30 Thread Gunnar Eketrapp
Hi!

For some reason my pages are rendered accoring to currentLocale and not
persistentLocale.

Is there something I should now?

Thanks in advance,
Gunnar Eketrapp


Re: Index page is activated for each page request ?

2009-10-30 Thread Gunnar Eketrapp
Hi !

When creating a minimal reproduction (not an easy task)  I realized that a
link in the footer seemed to part of the problem,

It was not tapified and included old links 
When I commented it out my app started to behave again!
I.e. not activating the index page for each page reques.



Thanks for the help
/Gunnar Ekerapp

2009/10/30 Gunnar Eketrapp 

> Hi and thanks for the effort!
>
> I will try to create a minimal reproduction.
>
> /Gunnar
>
> 2009/10/30 cordenier christophe 
>
> Hi
>>
>> I have made a test and cannot reproduce this behaviour, can you send a
>> sample that reproduces it ?
>>
>> Regards,
>> Christophe.
>>
>> 2009/10/30 Gunnar Eketrapp 
>>
>> > Hi!
>> >
>> > By some reason my index page is activated after each page request.
>> >
>> > What have I missed?
>> >
>> > Thanks in advance!
>> > /Gunnar Eketrapp
>> >
>>
>
>
>
> --
> [Hem: 08-715 59 57, Mobil: 0708-52 62 90]
> Allévägen 2A, 132 42 Saltsjö-Boo
>



-- 
[Hem: 08-715 59 57, Mobil: 0708-52 62 90]
Allévägen 2A, 132 42 Saltsjö-Boo


Re: T5:how to support AJAX submit

2009-10-30 Thread cleverpig
thanks! it's really good solution!

in another side:
if we do some background-process such as "autosave" when user input a long form.
we should use ajax.periodUpdater method to save data automaticly,but
this way only can use url as target without ability to submit form.
so where can we get the form submitted data?
in ajax way,it could be done with serialized form into json format,but
in the page event handle hwo to identify and process them?

On Fri, Oct 30, 2009 at 4:43 PM, Ulrich Stärk  wrote:
> "Binding the zone parameter will cause the form submission to be handled as
> an Ajax request that updates the indicated zone. Often a Form will update
> the same zone that contains it."
>
> http://tapestry.apache.org/tapestry5.1/tapestry-core/ref/org/apache/tapestry5/corelib/components/Form.html
>
> So just put a zone component around your form and point the form's zone
> attribute to that zone.
>
> Uli
>
> Am 30.10.2009 05:55 schrieb cleverpig:
>>
>> Currently the Editor component does not support an asynchronous submit
>> (AJAX).
>>
>> for example:
>> 1.build a form with submit button to save data to database.
>> 2.add a mixins which listening click event to this submit button with
>> ajax request & callback.
>> 3.when user click this submit button,the form will submit & return.
>> 4.so ajax request maybe be handled,but callback will lost,since the form
>> submit.
>>
>> and how to use post way in ajax, so that tapestry event handler counld
>> accept the ajax post?
>>
>> do you have idea on it?
>>
>>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>



-- 
cleverpig(Dan)
Location: Beijing
Address: Room 4018,No.A2 South Avenue Fuxingmen Beijing,P.R.China
Zipcode: 100031
MSN: great_liu...@hotmail.com
QQ: 149291732
Skype: cleverpigatmatrix
Facebook ID:cleverpig
Blog: www.cleverpig.name
Tags: del.icio.us/cleverpig
Twitter: twitter.com/cleverpig
新浪微博: t.sina.com.cn/cleverpig
Organization: www.beijing-open-party.org
or...@facebook: http://www.facebook.com/group.php?gid=8159558294

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



Re: Index page is activated for each page request ?

2009-10-30 Thread Gunnar Eketrapp
Hi and thanks for the effort!

I will try to create a minimal reproduction.

/Gunnar

2009/10/30 cordenier christophe 

> Hi
>
> I have made a test and cannot reproduce this behaviour, can you send a
> sample that reproduces it ?
>
> Regards,
> Christophe.
>
> 2009/10/30 Gunnar Eketrapp 
>
> > Hi!
> >
> > By some reason my index page is activated after each page request.
> >
> > What have I missed?
> >
> > Thanks in advance!
> > /Gunnar Eketrapp
> >
>



-- 
[Hem: 08-715 59 57, Mobil: 0708-52 62 90]
Allévägen 2A, 132 42 Saltsjö-Boo


Re: Index page is activated for each page request ?

2009-10-30 Thread cordenier christophe
Hi

I have made a test and cannot reproduce this behaviour, can you send a
sample that reproduces it ?

Regards,
Christophe.

2009/10/30 Gunnar Eketrapp 

> Hi!
>
> By some reason my index page is activated after each page request.
>
> What have I missed?
>
> Thanks in advance!
> /Gunnar Eketrapp
>


Index page is activated for each page request ?

2009-10-30 Thread Gunnar Eketrapp
Hi!

By some reason my index page is activated after each page request.

What have I missed?

Thanks in advance!
/Gunnar Eketrapp


Re: Why is setupComponent called twice?

2009-10-30 Thread Gunnar Eketrapp
Hi!

I found a very strange thing ...

I have and Index page that just redirects to another page ...

public class Index  {

@InjectPage
private com.tellpoker.pages.AboutUs about;

public Object onActivate() {

return about;
}
}

... which was an attempt to change the default start page.

By some reason the about page gets fetched afer each page request ... but
not displayed.

So I have been living with this for some weeks without realising it.

When I removed my Index page everything was fine except for that I have no
default page. (a directory listing instead ...)

/Gunnar


2009/10/30 cordenier christophe 

> Well i cannot reproduce on 5.1.0.5.
>
> Can you give more details on how you use/declare your layout component ?
> If it contains other @AfterRender... annotations ?
>
> Christophe
>
> 2009/10/30 Gunnar Eketrapp 
>
> > Hi!
> >
> > I uninstalled both Firebug and Web Developer but the method is still
> called
> > twice.
> >
> > Must be some other issue ...
> >
> > /Gunnar
> >
> >
> >
> > 2009/10/30 cordenier christophe 
> >
> > > Hi
> > >
> > > I already encounter this kind of problems using Firebug (which make a
> > > second
> > > call to obtain JS of the current page)
> > >
> > > Regards
> > > Christophe.
> > >
> > > 2009/10/30 Gunnar Eketrapp 
> > >
> > > > Hi!
> > > >
> > > > I have a layout component in which I have a method ...
> > > >
> > > > @SetupRender
> > > > void setupComponent() {
> > > >...
> > > > }
> > > >
> > > > For some reason this method is called twice for each page request.
> > > >
> > > > Can anyone explain why?
> > > >
> > > > Thanks in advance!
> > > > /Gunnar Eketrapp
> > > >
> > >
> >
> >
> >
> > --
> > [Hem: 08-715 59 57, Mobil: 0708-52 62 90]
> > Allévägen 2A, 132 42 Saltsjö-Boo
> >
>



-- 
[Hem: 08-715 59 57, Mobil: 0708-52 62 90]
Allévägen 2A, 132 42 Saltsjö-Boo


Re: How to avoid contribution to TypeCoercer in my case.

2009-10-30 Thread Niclas.Meier
Hi sandeep,

The effekt that occurs is, that tapestry tries to provide a loop
context/state for the enclosing form. You need this if you have any fields
in your loop.

If you don¹t want/need to provide a context you may mark the loop as
voliatile. This looks like:

 ...

  
Otherwise you'll have to provide a form state. I guess it would look like

 ... 

The tapestry error message in this case is - IMHO - improvable ;-)

Regards
Niclas


On 30.10.09 08:31, "sandeepraj singh" 
wrote:

> 
> 
> Hi All,
> I have the following
> 
> In MyComponent.tml
> 
>
>  ${MyDataObject.someothervariable} 
>
> 
> 
> Ofcourse there is supporting code for the same in MyComponent.java. ie.
> having an istance variable of MyDataObject etc.
> 
> In my Page, there are 2 cases
> 1) I use the component without an enclosing form. In this case the component
> works abs fine.
> 2) I use the component with an enclosing form. In such a case ,i recieve
> co-ercion error because of the context value that is being passed and is
> mapped to MyDataObject. The error is recieved only when the Enclosing FORM
> IS SUBMITTED.
> 
> For scenario 2, i make a contribution to TypeCoercer to force creation of
> MyDataObject so that the problem is solved. But can any one think of a
> better way. A way in which some code in My Component takes care of the
> problem rather than a contribution inthe service.
> 
> Thanks
> sandeep
> --
> View this message in context:
> http://old.nabble.com/How-to-avoid-contribution-to-TypeCoercer-in-my-case.-tp2
> 6126002p26126002.html
> Sent from the Tapestry - User mailing list archive at Nabble.com.
> 
> 
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
> 
> 


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



Re: Why is setupComponent called twice?

2009-10-30 Thread cordenier christophe
Well i cannot reproduce on 5.1.0.5.

Can you give more details on how you use/declare your layout component ?
If it contains other @AfterRender... annotations ?

Christophe

2009/10/30 Gunnar Eketrapp 

> Hi!
>
> I uninstalled both Firebug and Web Developer but the method is still called
> twice.
>
> Must be some other issue ...
>
> /Gunnar
>
>
>
> 2009/10/30 cordenier christophe 
>
> > Hi
> >
> > I already encounter this kind of problems using Firebug (which make a
> > second
> > call to obtain JS of the current page)
> >
> > Regards
> > Christophe.
> >
> > 2009/10/30 Gunnar Eketrapp 
> >
> > > Hi!
> > >
> > > I have a layout component in which I have a method ...
> > >
> > > @SetupRender
> > > void setupComponent() {
> > >...
> > > }
> > >
> > > For some reason this method is called twice for each page request.
> > >
> > > Can anyone explain why?
> > >
> > > Thanks in advance!
> > > /Gunnar Eketrapp
> > >
> >
>
>
>
> --
> [Hem: 08-715 59 57, Mobil: 0708-52 62 90]
> Allévägen 2A, 132 42 Saltsjö-Boo
>


Re: Why is setupComponent called twice?

2009-10-30 Thread Gunnar Eketrapp
Hi!

I uninstalled both Firebug and Web Developer but the method is still called
twice.

Must be some other issue ...

/Gunnar



2009/10/30 cordenier christophe 

> Hi
>
> I already encounter this kind of problems using Firebug (which make a
> second
> call to obtain JS of the current page)
>
> Regards
> Christophe.
>
> 2009/10/30 Gunnar Eketrapp 
>
> > Hi!
> >
> > I have a layout component in which I have a method ...
> >
> > @SetupRender
> > void setupComponent() {
> >...
> > }
> >
> > For some reason this method is called twice for each page request.
> >
> > Can anyone explain why?
> >
> > Thanks in advance!
> > /Gunnar Eketrapp
> >
>



-- 
[Hem: 08-715 59 57, Mobil: 0708-52 62 90]
Allévägen 2A, 132 42 Saltsjö-Boo


Re: T5:how to support AJAX submit

2009-10-30 Thread Inge Solvoll
Also, you can observe the Tapestry.ZONE_UPDATED_EVENT on the zone element
for your callback hook.

Like this: $('myZoneId').observe(Tapestry.ZONE_UPDATED_EVENT, myFunction);

See
http://tapestry.apache.org/tapestry5/tapestry-core/ref/org/apache/tapestry5/corelib/components/Zone.html

On Fri, Oct 30, 2009 at 9:43 AM, Ulrich Stärk  wrote:

> "Binding the zone parameter will cause the form submission to be handled as
> an Ajax request that updates the indicated zone. Often a Form will update
> the same zone that contains it."
>
>
> http://tapestry.apache.org/tapestry5.1/tapestry-core/ref/org/apache/tapestry5/corelib/components/Form.html
>
> So just put a zone component around your form and point the form's zone
> attribute to that zone.
>
> Uli
>
> Am 30.10.2009 05:55 schrieb cleverpig:
>
>  Currently the Editor component does not support an asynchronous submit
>> (AJAX).
>>
>> for example:
>> 1.build a form with submit button to save data to database.
>> 2.add a mixins which listening click event to this submit button with
>> ajax request & callback.
>> 3.when user click this submit button,the form will submit & return.
>> 4.so ajax request maybe be handled,but callback will lost,since the form
>> submit.
>>
>> and how to use post way in ajax, so that tapestry event handler counld
>> accept the ajax post?
>>
>> do you have idea on it?
>>
>>
>>
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>


Re: Why is setupComponent called twice?

2009-10-30 Thread cordenier christophe
Hi

I already encounter this kind of problems using Firebug (which make a second
call to obtain JS of the current page)

Regards
Christophe.

2009/10/30 Gunnar Eketrapp 

> Hi!
>
> I have a layout component in which I have a method ...
>
> @SetupRender
> void setupComponent() {
>...
> }
>
> For some reason this method is called twice for each page request.
>
> Can anyone explain why?
>
> Thanks in advance!
> /Gunnar Eketrapp
>


Why is setupComponent called twice?

2009-10-30 Thread Gunnar Eketrapp
Hi!

I have a layout component in which I have a method ...

@SetupRender
void setupComponent() {
...
}

For some reason this method is called twice for each page request.

Can anyone explain why?

Thanks in advance!
/Gunnar Eketrapp


Re: T5: ClasspathResource and performance

2009-10-30 Thread Christiansen Merel
Hi all,

Thanks for your answers.

I've already stripped down the supported locale list to the only one
needed. We still have two missed hit for each tried locale.

The tapestry.file-check-interval doesn't help either. The
file-check-interval is seems to be used only for existing files.

I guess the decorator will do the trick. Thanks.

Cheers,

--
ChristianZen

2009/10/29 Ulrich Stärk :
> Doesn't limiting the supported locales to just the ones you support help?
>
> http://tapestry.apache.org/tapestry5.0/guide/conf.html
>
> Uli
>
> Am 29.10.2009 19:39 schrieb Christiansen Merel:
>>
>> Hello out there,
>>
>> We're running a quite busy website with tapestry 5.0.18 and we're
>> hitting a performance problem with the ClasspathResource class.
>>
>> We're using classpath asset and none of them is localised. For each
>> hit on a page using a classpath asset, we end having 2 missed queries
>> on the ClassLoader for potential localized version of the asset. It
>> does not really slow down the application throughput but we end with
>> an __huge__ CPU consumption.
>>
>> The javacore stack shows numerous threads scanning jar files:
>>
>> 3XMTHREADINFO      "[ACTIVE] ExecuteThread: '2' for queue:
>> 'weblogic.kernel.Default (self-tuning)'" (TID:0x3700E400,
>> sys_thread_t:0x3393D030, state:B, native ID:0x009AB0B3) prio=5
>> 4XESTACKTRACE          at
>> java/util/zip/ZipFile.getEntry(ZipFile.java:287(Compiled Code))
>> 4XESTACKTRACE          at
>> java/util/jar/JarFile.getEntry(JarFile.java:283(Compiled Code))
>> 4XESTACKTRACE          at
>> java/util/jar/JarFile.getJarEntry(JarFile.java:266(Compiled Code))
>> 4XESTACKTRACE          at
>> sun/misc/URLClassPath$JarLoader.getResource(URLClassPath.java:949(Compiled
>> Code))
>> 4XESTACKTRACE          at
>>
>> sun/misc/URLClassPath$JarLoader.findResource(URLClassPath.java:938(Compiled
>> Code))
>> 4XESTACKTRACE          at
>> sun/misc/URLClassPath.findResource(URLClassPath.java:299(Compiled
>> Code))
>> 4XESTACKTRACE          at
>> java/net/URLClassLoader$3.run(URLClassLoader.java:784(Compiled Code))
>> 4XESTACKTRACE          at
>> java/security/AccessController.doPrivileged(AccessController.java:219)
>> 4XESTACKTRACE          at
>> java/net/URLClassLoader.findResource(URLClassLoader.java:781(Compiled
>> Code))
>> 4XESTACKTRACE          at
>> java/lang/ClassLoader.getResource(ClassLoader.java:420(Compiled Code))
>> 4XESTACKTRACE          at
>> java/lang/ClassLoader.getResource(ClassLoader.java:415(Compiled Code))
>> 4XESTACKTRACE          at
>> java/lang/ClassLoader.getResource(ClassLoader.java:415(Compiled Code))
>> 4XESTACKTRACE          at
>>
>> weblogic/utils/classloaders/GenericClassLoader.getResourceInternal(GenericClassLoader.java:170(Compiled
>> Code))
>> 4XESTACKTRACE          at
>>
>> weblogic/utils/classloaders/GenericClassLoader.getResource(GenericClassLoader.java:187(Compiled
>> Code))
>> 4XESTACKTRACE          at
>>
>> weblogic/utils/classloaders/FilteringClassLoader.getResourceInternal(FilteringClassLoader.java:89(Compiled
>> Code))
>> 4XESTACKTRACE          at
>>
>> weblogic/utils/classloaders/GenericClassLoader.getResourceInternal(GenericClassLoader.java:155(Compiled
>> Code))
>> 4XESTACKTRACE          at
>>
>> weblogic/utils/classloaders/GenericClassLoader.getResource(GenericClassLoader.java:187(Compiled
>> Code))
>> 4XESTACKTRACE          at
>> java/lang/ClassLoader.getResource(ClassLoader.java:415(Compiled Code))
>> 4XESTACKTRACE          at
>>
>> weblogic/utils/classloaders/GenericClassLoader.getResource(GenericClassLoader.java:190(Compiled
>> Code))
>> 4XESTACKTRACE          at
>>
>> weblogic/utils/classloaders/ChangeAwareClassLoader.getResource(ChangeAwareClassLoader.java:118(Compiled
>> Code))
>> 4XESTACKTRACE          at
>>
>> org/apache/tapestry5/ioc/internal/util/ClasspathResource.toURL(ClasspathResource.java:59(Compiled
>> Code))
>> 4XESTACKTRACE          at
>>
>> org/apache/tapestry5/ioc/internal/util/AbstractResource.exists(AbstractResource.java:137(Compiled
>> Code))
>> 4XESTACKTRACE          at
>>
>> org/apache/tapestry5/ioc/internal/util/AbstractResource.forLocale(AbstractResource.java:100(Compiled
>> Code))
>> 4XESTACKTRACE          at
>>
>> org/apache/tapestry5/internal/services/AssetSourceImpl.findRelativeAsset(AssetSourceImpl.java:99(Compiled
>> Code))
>> 4XESTACKTRACE          at
>>
>> org/apache/tapestry5/internal/services/AssetSourceImpl.getAsset(AssetSourceImpl.java:93(Compiled
>> Code))
>> 4XESTACKTRACE          at
>> $AssetSource_124955c0e4c.getAsset($AssetSource_124955c0e4c.java(Compiled
>> Code))
>> 4XESTACKTRACE          at
>>
>> org/apache/tapestry5/internal/transform/AbstractIncludeAssetWorker$1.perform(AbstractIncludeAssetWorker.java:79(Compiled
>> Code))
>> 4XESTACKTRACE          at
>>
>> fr/poleemploi/d2i/tapestry/navigation/unifiee/components/Bandeau.setupRender(Bandeau.java(Compiled
>> Code))
>>
>> The stack comes from weblogic/aix run but the problem is the same on
>> other platforms as well.
>>
>> Does anyone has ever e

Re: T5:how to support AJAX submit

2009-10-30 Thread Ulrich Stärk
"Binding the zone parameter will cause the form submission to be handled as an Ajax request that 
updates the indicated zone. Often a Form will update the same zone that contains it."


http://tapestry.apache.org/tapestry5.1/tapestry-core/ref/org/apache/tapestry5/corelib/components/Form.html

So just put a zone component around your form and point the form's zone 
attribute to that zone.

Uli

Am 30.10.2009 05:55 schrieb cleverpig:

Currently the Editor component does not support an asynchronous submit (AJAX).

for example:
1.build a form with submit button to save data to database.
2.add a mixins which listening click event to this submit button with
ajax request & callback.
3.when user click this submit button,the form will submit & return.
4.so ajax request maybe be handled,but callback will lost,since the form submit.

and how to use post way in ajax, so that tapestry event handler counld
accept the ajax post?

do you have idea on it?




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



How to avoid contribution to TypeCoercer in my case.

2009-10-30 Thread sandeepraj singh

Hi All,
I have the following

In MyComponent.tml


 ${MyDataObject.someothervariable} 



Ofcourse there is supporting code for the same in MyComponent.java. ie.
having an istance variable of MyDataObject etc.

In my Page, there are 2 cases
1) I use the component without an enclosing form. In this case the component
works abs fine.
2) I use the component with an enclosing form. In such a case ,i recieve
co-ercion error because of the context value that is being passed and is
mapped to MyDataObject. The error is recieved only when the Enclosing FORM
IS SUBMITTED.

For scenario 2, i make a contribution to TypeCoercer to force creation of
MyDataObject so that the problem is solved. But can any one think of a
better way. A way in which some code in My Component takes care of the
problem rather than a contribution inthe service.

Thanks
sandeep
-- 
View this message in context: 
http://old.nabble.com/How-to-avoid-contribution-to-TypeCoercer-in-my-case.-tp26126002p26126002.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


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