Re: t:form cannot be created?

2011-08-02 Thread Howard Lewis Ship
This is quite odd; I'd check your compiler settings ... Tapestry 5.2
is a bit sensitive about JDK version, sometimes 1.6 throws it for a
loop (that's the Javassist bytecode library, which has been sidelined
in Tapestry 5.3).

On Tue, Aug 2, 2011 at 4:02 PM, nillehammer
 wrote:
> Look around line 90 in your AppModule
> (com.packtpub.services.AppModule$1.service(AppModule.java:90)) and see, if
> you can get a clue. If not, please post your AppModule's code and we'll see,
> if we can find an error.
>
> -
> http://www.winfonet.eu
> --
> View this message in context: 
> http://tapestry.1045711.n5.nabble.com/t-form-cannot-be-created-tp4657559p4660602.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
>
>



-- 
Howard M. Lewis Ship

Creator of Apache Tapestry

The source for Tapestry training, mentoring and support. Contact me to
learn how I can get you up and productive in Tapestry fast!

(971) 678-5210
http://howardlewisship.com

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



Re: Specifying several event constants for the @OnEvent annotation?

2011-08-02 Thread Howard Lewis Ship
-1

Thiago had the right solution.  Further, the second event
("fromMyAjaxEvent") will occur after the "activate" event itself
(assuming that the Ajax-request originating component is on the same
page).

It is very much an exception to the rule to have multiple events
handled by the same method. It is occasionally useful to have a single
method handle events from multiple component ids (by exploding the
"from" portion of the method name).

On Tue, Aug 2, 2011 at 4:03 PM, Taha Hafeez  wrote:
> How about having a new annotation ??
>
> @OnEvents(
>   {
>      @OnEvent(...), @OnEvent(...)
>   })
>
>
> On Wed, Aug 3, 2011 at 4:22 AM, nillehammer
>  wrote:
>> You could implement one method that is called by your two event handlers.
>> E.g.
>>
>> @OnEvent(EventConstants.ACTIVATE)
>> final void callEventHandlerFromActivate() {
>>  this.doTheWork();
>> }
>>
>> @OnEvent("yourAjaxEvent")
>> final void callEventHandlerFromMyAjaxEvent() {
>>  this.doTheWork();
>> }
>>
>> private final void doTheWork() {
>> ...
>> }
>>
>>
>> -
>> http://www.winfonet.eu
>> --
>> View this message in context: 
>> http://tapestry.1045711.n5.nabble.com/Specifying-several-event-constants-for-the-OnEvent-annotation-tp4659025p4660584.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
>>
>>
>
>
>
> --
>
> regards
>
> Taha Hafeez Siddiqi (tawus)
> http://tawus.wordpress.com
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>



-- 
Howard M. Lewis Ship

Creator of Apache Tapestry

The source for Tapestry training, mentoring and support. Contact me to
learn how I can get you up and productive in Tapestry fast!

(971) 678-5210
http://howardlewisship.com

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



Re: Specifying several event constants for the @OnEvent annotation?

2011-08-02 Thread Taha Hafeez
How about having a new annotation ??

@OnEvents(
   {
  @OnEvent(...), @OnEvent(...)
   })


On Wed, Aug 3, 2011 at 4:22 AM, nillehammer
 wrote:
> You could implement one method that is called by your two event handlers.
> E.g.
>
> @OnEvent(EventConstants.ACTIVATE)
> final void callEventHandlerFromActivate() {
>  this.doTheWork();
> }
>
> @OnEvent("yourAjaxEvent")
> final void callEventHandlerFromMyAjaxEvent() {
>  this.doTheWork();
> }
>
> private final void doTheWork() {
> ...
> }
>
>
> -
> http://www.winfonet.eu
> --
> View this message in context: 
> http://tapestry.1045711.n5.nabble.com/Specifying-several-event-constants-for-the-OnEvent-annotation-tp4659025p4660584.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
>
>



-- 

regards

Taha Hafeez Siddiqi (tawus)
http://tawus.wordpress.com

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



Re: t:form cannot be created?

2011-08-02 Thread nillehammer
Look around line 90 in your AppModule
(com.packtpub.services.AppModule$1.service(AppModule.java:90)) and see, if
you can get a clue. If not, please post your AppModule's code and we'll see,
if we can find an error.

-
http://www.winfonet.eu
--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/t-form-cannot-be-created-tp4657559p4660602.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: Specifying several event constants for the @OnEvent annotation?

2011-08-02 Thread nillehammer
You could implement one method that is called by your two event handlers.
E.g.

@OnEvent(EventConstants.ACTIVATE)
final void callEventHandlerFromActivate() {
 this.doTheWork();
}

@OnEvent("yourAjaxEvent")
final void callEventHandlerFromMyAjaxEvent() {
 this.doTheWork();
}

private final void doTheWork() {
...
}


-
http://www.winfonet.eu
--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/Specifying-several-event-constants-for-the-OnEvent-annotation-tp4659025p4660584.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: Some Tapestry infection questions

2011-08-02 Thread Taha Hafeez
Hi

I also had this error message some time back when I created a non
default constructor in my page/component and forgot to create a PUBLIC
default constructor. The scope of constructor is important here.


On Tue, Aug 2, 2011 at 9:46 PM, ERNESTO ARROYO RON  wrote:
> I am on holidays, and trying to use some Tapestry awesome features, as the 
> inyection.
>
> But I do not understand some issues, and cannot find the answer in the wiki 
> or somewhere, to the info is not enough clear for me, sorry.
>
> This is very simple. In the Java part of a page I want to inject the DAO, so 
> I use this code:
>
> @Inject
> private IAplicacionesDAO appDAO;
>
> To have this code running I need to add the service implementation via 
> AppModule and bind:
>
> public static void bind(ServiceBinder binder)
>    {
>        binder.bind(IAplicacionesDAO.class,AplicacionesDAO.class);
>
> Two questions:
>
> a) if I add a constructor to the first class, I have an error:
> Class com.earroyoron.pages.VerAplicaciones was not transformed for use as a 
> component; this can happen if it is an interface, or was not in a package 
> subject to component transformation
> and in the documentation I read the constructor was needed! But without it 
> works and with it I have an error….
>
> b) Cannot Tapestry find the service without the bind? The infection in the 
> DAO to use Hibernate does not need to say nothing to Tapestry, it works 
> without any extra configuration in module.
>
>
> Thank you in advance, when I learn I promise to help the newbies!
> :O)
>
>



-- 

regards

Taha Hafeez Siddiqi (tawus)
http://tawus.wordpress.com

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



Re: Netbeans and Tapestry integration

2011-08-02 Thread Alex Kotchnev
The live reloading doesn't depend on anything eclipse specific - it's a
tapestry feature. As long as your compiled classes end up in a container
that supports it (e.g. in the past, I've had problems w/ live reloading and
Tomcat), you should be OK.

The "Compile on Save" feature in NetBeans is something that you definitely
want to enable in your project properties - this is what compiles the
classes and would put them where the servlet container needs them (make sure
that you don't do "Deploy on Save" as that completely removes the need for
tapestry live reloading as it uses integration w/ the servlet container) .

Are you using native NetBeans projects or are you working w/ NetBeans and
Maven projects (btw, both should work, but probably slightly differently)  ?


Cheers,

Alex K

On Tue, Aug 2, 2011 at 12:08 PM, earroyoron  wrote:

> First, I am sorry this email was sent to dev@tapestry list too, it was my
> fault!
>
> The message was:
>
> Hi all!
>
> I am starting to use Tapestry,… impressive framework!
>
> I am developing an application, using eclipse, and I had some problems with
> DerbyDB. I prefer Netbeans to do some things, and I could resolve my "derby
> affair" with the NetBeansIDE.
>
> But now I was still using NB and, I, … is my fault or the live reloading
> feature does not work when you are using NBeans? I edit a file (java or tml)
> and it is not updated in jetty, and it works when using eclipse!
>
> Does the live reloading uses some eclipse "thing"?
>
> Thanks!
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>


Re: Some Tapestry infection questions

2011-08-02 Thread Rich M

On 08/02/2011 12:16 PM, ERNESTO ARROYO RON wrote:

I am on holidays, and trying to use some Tapestry awesome features, as the 
inyection.

But I do not understand some issues, and cannot find the answer in the wiki or 
somewhere, to the info is not enough clear for me, sorry.

This is very simple. In the Java part of a page I want to inject the DAO, so I 
use this code:

@Inject
private IAplicacionesDAO appDAO;

To have this code running I need to add the service implementation via 
AppModule and bind:

public static void bind(ServiceBinder binder)
 {
binder.bind(IAplicacionesDAO.class,AplicacionesDAO.class);

Two questions:

a) if I add a constructor to the first class, I have an error:
Class com.earroyoron.pages.VerAplicaciones was not transformed for use as a 
component; this can happen if it is an interface, or was not in a package 
subject to component transformation
and in the documentation I read the constructor was needed! But without it 
works and with it I have an error….
A constructor should not be used in a Page or Component class. Tapestry 
does a lot of work behind the scenes when deployed to transform these 
classes you write so they function nicely. Read up on the page 
lifecycle: http://tapestry.apache.org/page-life-cycle.html


I assume there is some initialization you would like to do on your page 
when it is rendered and displayed (which you may have thought belonged 
in a constructor), for this you would implement one of the render 
lifecycle methods.  http://tapestry.apache.org/component-rendering.html


For example

@BeginRender
public void loadUser(){
userId = 1;
appDAO.loadUser(userId);
}


b) Cannot Tapestry find the service without the bind? The infection in the DAO 
to use Hibernate does not need to say nothing to Tapestry, it works without any 
extra configuration in module.

You will need to do the binding so it can auto-bind your service for 
you. You could alternately write a build method to build the service 
yourself, but that would be more work and I'm assuming is not what you 
wanted. http://tapestry.apache.org/defining-tapestry-ioc-services.html

Thank you in advance, when I learn I promise to help the newbies!
:O)





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



Some Tapestry infection questions

2011-08-02 Thread ERNESTO ARROYO RON
I am on holidays, and trying to use some Tapestry awesome features, as the 
inyection.

But I do not understand some issues, and cannot find the answer in the wiki or 
somewhere, to the info is not enough clear for me, sorry.

This is very simple. In the Java part of a page I want to inject the DAO, so I 
use this code:

@Inject
private IAplicacionesDAO appDAO;

To have this code running I need to add the service implementation via 
AppModule and bind:

public static void bind(ServiceBinder binder)
{
binder.bind(IAplicacionesDAO.class,AplicacionesDAO.class);

Two questions:

a) if I add a constructor to the first class, I have an error:
Class com.earroyoron.pages.VerAplicaciones was not transformed for use as a 
component; this can happen if it is an interface, or was not in a package 
subject to component transformation
and in the documentation I read the constructor was needed! But without it 
works and with it I have an error….

b) Cannot Tapestry find the service without the bind? The infection in the DAO 
to use Hibernate does not need to say nothing to Tapestry, it works without any 
extra configuration in module.


Thank you in advance, when I learn I promise to help the newbies! 
:O)



Netbeans and Tapestry integration

2011-08-02 Thread earroyoron
First, I am sorry this email was sent to dev@tapestry list too, it was my fault!

The message was:

Hi all!

I am starting to use Tapestry,… impressive framework!

I am developing an application, using eclipse, and I had some problems with 
DerbyDB. I prefer Netbeans to do some things, and I could resolve my "derby 
affair" with the NetBeansIDE.

But now I was still using NB and, I, … is my fault or the live reloading 
feature does not work when you are using NBeans? I edit a file (java or tml) 
and it is not updated in jetty, and it works when using eclipse!

Does the live reloading uses some eclipse "thing"?

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



Re: Specifying several event constants for the @OnEvent annotation?

2011-08-02 Thread Julien Martin
Hello Igor,
I need this method to be called
1. when the page is activated (for a normal render)
2. and also when an ajax method is called (for an ajax render).
Is this possible?
Regards,
Julien.

2011/8/2 Igor Drobiazko 

> If the handler methods for two different events are same, then you probably
> need only a single event.
>
> BTW: Firing activate event might cause unexpected behavior as activate is
> already "reserved" by Tapestry.
>
> On Tue, Aug 2, 2011 at 5:06 PM, Julien Martin  wrote:
>
> > Hello,
> > I need for a method to be called upon several events (e.g. ACTIVATE and
> > ACTION).
> > I tried the following:
> >
> > *@OnEvent(value = {EventConstants.ACTIVATE, EventConstants.ACTION})
> >void loadJobPostings() {
> >jobPostings = service.loadJobPostings();
> >}
> > *
> > and it does not work/compile unfortunately. Am I missing something?
> > Can anyone please help?
> > Regards,
> > Julien.
> >
>
>
>
> --
> Best regards,
>
> Igor Drobiazko
> http://tapestry5.de
>


T5.3: customize validation messages

2011-08-02 Thread stephanos2k
I'm running T5.3 and want to overwrite the existing validation messages. I
created my own file 'MyValidationMessages.properties' and tried to
contribute it.

But I only found references to the deprecated
'contributeComponentMessagesSource', or hints to
'contributeComponentMessagesSource' - but I don't quite understand how to
apply it to my case.

What's the correct way?

Cheers,
Stephan

--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/T5-3-customize-validation-messages-tp4659356p4659356.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: Specifying several event constants for the @OnEvent annotation?

2011-08-02 Thread Igor Drobiazko
If the handler methods for two different events are same, then you probably
need only a single event.

BTW: Firing activate event might cause unexpected behavior as activate is
already "reserved" by Tapestry.

On Tue, Aug 2, 2011 at 5:06 PM, Julien Martin  wrote:

> Hello,
> I need for a method to be called upon several events (e.g. ACTIVATE and
> ACTION).
> I tried the following:
>
> *@OnEvent(value = {EventConstants.ACTIVATE, EventConstants.ACTION})
>void loadJobPostings() {
>jobPostings = service.loadJobPostings();
>}
> *
> and it does not work/compile unfortunately. Am I missing something?
> Can anyone please help?
> Regards,
> Julien.
>



-- 
Best regards,

Igor Drobiazko
http://tapestry5.de


Re: Can't call EventLink when ajax popup another page.

2011-08-02 Thread Bo Gao
Thanks very much.

Finally I found my problem. I have the following code on my page
Object onActivate(){
if(someSessionScopeObject==null){
return Index.class;
}
}

And on my Index page
Object onActivate(){
sessionManager.set(theSessionScopeObject.class, null);
}

And when I load the component using ajax, Tapestry call Index.onActive, clear 
the sessionScopeObject, 
Then if i click an eventlink on the first page, mypage.onActive is called. And 
I am redirected to Index page.

It's all my mistake.

On Aug 2, 2011, at 12:36 AM, Taha Hafeez wrote:

> Hi
> 
> On Mon, Aug 1, 2011 at 9:57 PM, Bo Gao  wrote:
>> In my page, i use ajax to load another page into a popup window(a floating 
>> div). the code is like this
>> ...
>> var manager = new Tapestry.ZoneManager({
>>"element" : this.zone
>> });
>> manager.updateFromURL(this.url);
>> 
>> and the problems is that if then I click any Event link in the main page to 
>> update a zone,
>> the returned json contains something like redirect: "/", and be redirected 
>> to Index page.
>> 
> 
> The redirection can be because of a number of reasons like an invalid
> context parameter, or security redirection, or even a redirection in
> your own page.
> 
>> I guess when I load another page in a popup window, the active page changed. 
>> So I can't
>> call the event link on that page.
> 
> No, it doesn't work that way. Event links have no concept of an active
> page. You can even directly type in an event llink in the address bar
> and it will still work.
> 
>> 
>> In this situation, how to make these event link works,
>> 
>> I see some url created by ComponentResources.createEventLink, contains 
>> ?t:cp=some/page
>> What's this means, can this help to solve my problem?
>> 
> 
> It think it means that your event url is coming from a block belonging
> to some other page.
> 
>> Thanks very much.
>> 
>> --
>> Bo Gao
>> eli...@gmail.com
>> 
>> 
> 
>> 
>> 
>> 
>> 
>> 
> 
> 
> 
> -- 
> 
> regards
> 
> Taha Hafeez Siddiqi (tawus)
> http://tawus.wordpress.com
> 
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
> 

--
Bo Gao
eli...@gmail.com








Specifying several event constants for the @OnEvent annotation?

2011-08-02 Thread Julien Martin
Hello,
I need for a method to be called upon several events (e.g. ACTIVATE and
ACTION).
I tried the following:

*@OnEvent(value = {EventConstants.ACTIVATE, EventConstants.ACTION})
void loadJobPostings() {
jobPostings = service.loadJobPostings();
}
*
and it does not work/compile unfortunately. Am I missing something?
Can anyone please help?
Regards,
Julien.


Re: Remove @PageAttached & @PageDetached

2011-08-02 Thread Massimo Lusetti
On Sun, Jul 24, 2011 at 6:00 AM, Howard Lewis Ship  wrote:

> Is anyone aware of any use of @PageAttached or @PageDetached in any
> library or component?  Since 5.2, with the advent of page singletons,
> they don't appear to make any sense.
>
> I've been making a lot of internal changes to the code, to reduce
> Tapestry's memory footprint and improve performance.  I'm looking even
> further, at things that are unused today and can be removed in a later
> release, such as 5.4.
>
> I've marked them as deprecated; if anyone has a use for these methods,
> please pipe up soon.  I don't have a problem un-deprecating them if
> there is an actual valid use for them.

Yes sure... go ahead.

> I may look at some of the lesser used render phase methods as well.

This will be a big win IMHO... You have already my +1 vote on this one! ...

-- 
Massimo
http://meridio.blogspot.com

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



t:form cannot be created?

2011-08-02 Thread eray
Hello everyone,

I am very new to Tapestry, so it can be that this is a silly question, but I
cannot find a way out of this situation. I am trying to apply the examples
in the Tapestry 5 book of A. Kolesnikov. I copy the error message and my
code below. There was a similar topic in the archive, but it didn't help me.

Thank you in advance.

Eray



An unexpected application exception has occurred.

org.apache.tapestry5.ioc.internal.OperationException
Failure creating embedded component 'userInputForm' of
com.packtpub.pages.Index: java.lang.NullPointerException
location
classpath:com/packtpub/pages/Index.tml, line 31
26  
27  
28  Go to Another 
page
29  
30  Submit a message:
31  
32  
33  
34  
35  
36  
trace
Constructing instance of page class com.packtpub.pages.Index
Creating ComponentAssembler for com.packtpub.pages.Index
java.lang.NullPointerException
Hide uninteresting stack frames Stack trace 
org.apache.tapestry5.internal.pageload.EmbeddedComponentAssemblerImpl.updateParameterNameToQualified(EmbeddedComponentAssemblerImpl.java:147)
org.apache.tapestry5.internal.pageload.EmbeddedComponentAssemblerImpl.prescanMixins(EmbeddedComponentAssemblerImpl.java:138)
org.apache.tapestry5.internal.pageload.EmbeddedComponentAssemblerImpl.(EmbeddedComponentAssemblerImpl.java:115)
org.apache.tapestry5.internal.pageload.ComponentAssemblerImpl.createEmbeddedAssembler(ComponentAssemblerImpl.java:276)
org.apache.tapestry5.internal.pageload.PageLoaderImpl.startComponent(PageLoaderImpl.java:749)
org.apache.tapestry5.internal.pageload.PageLoaderImpl.component(PageLoaderImpl.java:627)
org.apache.tapestry5.internal.pageload.PageLoaderImpl.processTemplateToken(PageLoaderImpl.java:426)
org.apache.tapestry5.internal.pageload.PageLoaderImpl.consumeToEndElementAndPopBodyElement(PageLoaderImpl.java:611)
org.apache.tapestry5.internal.pageload.PageLoaderImpl.parameter(PageLoaderImpl.java:559)
org.apache.tapestry5.internal.pageload.PageLoaderImpl.processTemplateToken(PageLoaderImpl.java:443)
org.apache.tapestry5.internal.pageload.PageLoaderImpl.component(PageLoaderImpl.java:648)
org.apache.tapestry5.internal.pageload.PageLoaderImpl.processTemplateToken(PageLoaderImpl.java:426)
org.apache.tapestry5.internal.pageload.PageLoaderImpl.programAssembler(PageLoaderImpl.java:264)
org.apache.tapestry5.internal.pageload.PageLoaderImpl.access$900(PageLoaderImpl.java:65)
org.apache.tapestry5.internal.pageload.PageLoaderImpl$4.invoke(PageLoaderImpl.java:236)
org.apache.tapestry5.internal.pageload.PageLoaderImpl$4.invoke(PageLoaderImpl.java:219)
org.apache.tapestry5.ioc.internal.OperationTrackerImpl.invoke(OperationTrackerImpl.java:65)
org.apache.tapestry5.ioc.internal.PerThreadOperationTracker.invoke(PerThreadOperationTracker.java:68)
org.apache.tapestry5.ioc.internal.RegistryImpl.invoke(RegistryImpl.java:1063)
org.apache.tapestry5.internal.pageload.PageLoaderImpl.createAssembler(PageLoaderImpl.java:218)
org.apache.tapestry5.internal.pageload.PageLoaderImpl.getAssembler(PageLoaderImpl.java:208)
org.apache.tapestry5.internal.pageload.PageLoaderImpl$3.invoke(PageLoaderImpl.java:180)
org.apache.tapestry5.internal.pageload.PageLoaderImpl$3.invoke(PageLoaderImpl.java:174)
org.apache.tapestry5.ioc.internal.OperationTrackerImpl.invoke(OperationTrackerImpl.java:65)
org.apache.tapestry5.ioc.internal.PerThreadOperationTracker.invoke(PerThreadOperationTracker.java:68)
org.apache.tapestry5.ioc.internal.RegistryImpl.invoke(RegistryImpl.java:1063)
org.apache.tapestry5.internal.pageload.PageLoaderImpl.loadPage(PageLoaderImpl.java:173)
org.apache.tapestry5.internal.services.PageSourceImpl.getPage(PageSourceImpl.java:81)
org.apache.tapestry5.internal.services.NonPoolingRequestPageCacheImpl.get(NonPoolingRequestPageCacheImpl.java:74)
org.apache.tapestry5.internal.services.PageRenderRequestHandlerImpl.handle(PageRenderRequestHandlerImpl.java:55)
org.apache.tapestry5.services.TapestryModule$36.handle(TapestryModule.java:2326)
org.apache.tapestry5.internal.services.ComponentRequestHandlerTerminator.handlePageRender(ComponentRequestHandlerTerminator.java:48)
org.apache.tapestry5.services.InitializeActivePageName.handlePageRender(InitializeActivePageName.java:47)
org.apache.tapestry5.internal.services.PageRenderDispatcher.dispatch(PageRenderDispatcher.java:45)
org.apache.tapestry5.services.TapestryModule$RequestHandlerTerminator.service(TapestryModule.java:321)
com.packtpub.services.AppModule$1.service(AppModule.java:90)
org.apache.tapestry5.internal.services.RequestErrorFilter.service(RequestErrorFilter.java:26)
org.apache.tapestry5.services.TapestryModule$4.service(TapestryModule.java:984)
org.apache.tapestry5.services.TapestryModule$3.service(TapestryModule.java:974)
org.apache.tapestry5.internal.services.StaticFilesFilter.service(StaticFilesFilter.

Re: onActivate doubt

2011-08-02 Thread David Canteros
Hi, thank you both for the answers!

I know the problem of passing user&pass via url, but for the time being I
can't change it.  All pages ( except Login ) are protected by
@RequiresAuthentication annotation of tapestry-security framework thus they
are locked if you are not logged. Login page appear because I have defined
the following security symbols in the Module:

*configuration.add(SecuritySymbols.LOGIN_URL, "/login");
configuration.add(SecuritySymbols.DEFAULTSIGNINPAGE, "/login");
configuration.add(SecuritySymbols.SUCCESS_URL, "/Index");
configuration.add(SecuritySymbols.UNAUTHORIZED_URL,
"/Unauthorized");*

My doubt was the onActivate() method behavior. Why was the page loaded and
wasn't onActivate launched? Do you think the way that the page was invoked (
implicitly) causes the behavior?. I will try nillehammer's suggestion, and
I'll have a look at jumpstart as well.

Thank you again!

David



--
David Germán Canteros


2011/7/29 Thiago H. de Paula Figueiredo 

> On Fri, 29 Jul 2011 19:58:40 -0300, David Canteros <
> davidcanteros@gmail.com> wrote:
>
>  I have to implement an automatic login on my tap application. I use tap
>> 5.2.6 and tapestry-security 0.3.1.
>> Initially I had a Login page with a login form,  but now I have to pass
>> the username and password to the login page via url, like this:
>> *http://localhost:8080/**MyAppName/login?usr=userName&**
>> pass=encryptedPass*
>>
>
> I'd never, ever, ever do that. It can open your application to replay
> attacks.
>
>
>  The problem is: If I write 
> "http://localhost:8080/**MyAppName/"
>> in my browser and hit enter, then the login page appear, but it doesn't
>> execute
>> onActivate() method! So I can't redirect to the external page. But if I
>> write "
>> http://localhost:8080/**MyAppName/login"
>> the method is executed. Anybody know why??
>>
>
> MyAppName is the context, so 
> http://localhost:8080/**MyAppName/is 
> requesting the Index page of your application. Your login page has URL
> /login, so what you're seeing is absolutely correct, expected behavior.
>
>
>  I thought that onActivate is always executed when a page is called.
>>
>
> It's only executed in the page that was requested. If you want to implement
> something that is executed in every page, search for ComponentRequestFilter
> in the mailing list or look here: http://jumpstart.**
> doublenegative.com.au/**jumpstart/examples/**
> infrastructure/protectingpages
>
> --
> Thiago H. de Paula Figueiredo
> Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,
> and instructor
> Owner, Ars Machina Tecnologia da Informação Ltda.
> http://www.arsmachina.com.br
>
>
> --**--**-
> To unsubscribe, e-mail: 
> users-unsubscribe@tapestry.**apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>