Re: New T5 blog

2009-10-15 Thread Inge Solvoll
http://tinybits.blogspot.com/2009/10/missing-javascript.html

Started working on AJAX extensions to the builtin Tapestry.js, contributions
from others would be great!

The function for submitting zone forms is quite simple, but also quite
useful I think.

The function for triggering a zone link is the most interesting one. It is
mostly a copy of Tapestry.js code, but modified to enable triggering links
without knowing the event url connected to the link. It is based on Tapestry
putting the actual link url in the href. As of now (5.1.0.5), it does.

My wish for the future is for this function to be built in, so we can call
"Tapestry.triggerZoneLink(linkElement)". And in Tapestry.js, linkZone
function, around line 800, I would like it to look like this:

element.observe("click", function(event)
{
Event.stop(event);

triggerZoneLink(element, url)
});


I would like to hear if anyone thinks this is a bad idea. Because if it is
not, it is really simple to just put it right into the core.

Regards

Inge


On Thu, May 21, 2009 at 1:22 AM, Inge Solvoll wrote:

> New blog entry, this time I've tried to improve/simplify a Chenillekit
> mixin. Check out my OnEvent mixin here:
>
> http://tinybits.blogspot.com/2009/05/simple-onevent-mixin.html
>
>
> On Fri, May 15, 2009 at 11:20 AM, Inge Solvoll wrote:
>
>>
>> http://tinybits.blogspot.com/2009/05/update-zone-on-any-client-side-event.html
>>
>> New post with code I believe I've posted here before. This mixin enables
>> you to trigger a zone update from any client side event, with the value of
>> the triggering element as event context.
>>
>> There are a couple of things contained in this mixin, that exemplifies
>> things that I think should be better supported by the framework:
>> - Javascript encoding function (copied from Equanda code)
>> - Having to manually wire up the event link context before performing the
>> request.
>> - To find a zone object and trigger an update on it is a bit
>> difficult/non-intuitive. Several JIRA issues have been raised about this, it
>> might be fixed in 5.1?
>>
>> Regards
>> Inge
>>
>>
>> On Wed, Apr 15, 2009 at 2:50 PM, Inge Solvoll wrote:
>>
>>> http://tinybits.blogspot.com/
>>>
>>> New post on my blog with another simple mixin that has been posted on the
>>> list before.
>>>
>>> Also worked a bit on the layout. Found that the best way to publish
>>> source code on blogger.com was to use Windows Live Writer with source
>>> code formatter plugin:
>>> http://skotl.blogspot.com/2009/02/posting-code-snipped-on-blogspotcom.html
>>> .
>>>
>>>
>>>
>>> On Fri, Apr 3, 2009 at 6:55 PM, Andreas Andreou wrote:
>>>
 no - it's the other way around :)

 the feeds we keep in our wiki entry - we can also add them to
 the ohloh page for the Tapestry project ( http://www.ohloh.net/p/4017 )


 On Fri, Apr 3, 2009 at 7:31 PM, Francois Armand 
 wrote:
 > Andreas Andreou wrote:
 >>
 >> You can also edit the rss feeds for Tapestry @ ohloh
 >> http://www.ohloh.net/p/4017
 >>
 >
 > I added the reference about it on the wiki page. But I can't see how
 to
 > suscribe in my rssreader on Ohloh Tapestry 5 feed... Do you know how
 to do
 > (what is the url for Ohloh T5 feed) ?
 >
 > --
 > Francois Armand
 > Etudes & Développements J2EE
 > Groupe Linagora - http://www.linagora.com
 > Tél.: +33 (0)1 58 18 68 28
 > ---
 > http://fanf42.blogspot.com
 > InterLDAP - http://interldap.org FederID - http://www.federid.org/
 > Open Source identities management and federation
 >
 >
 > -
 > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
 > For additional commands, e-mail: users-h...@tapestry.apache.org
 >
 >



 --
 Andreas Andreou - andy...@apache.org - http://blog.andyhot.gr
 Tapestry / Tacos developer
 Open Source / JEE Consulting

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


>>>
>>
>


Re: Question regarding complex URL rewriting and injecting

2009-10-15 Thread Igor Drobiazko
Hi Alexander,

On Thu, Oct 15, 2009 at 11:11 PM, Alexander Reelsen  wrote:

> Hi,
>
> after reading the new german book on Tapestry I am thinking to take a
> closer look at it. It is a very nice and clean structured book, which
> can be read quite easily at a rainy weekend. Very well done.
>

It's nice to read some feedback from readers. Thanks!. I'm really happy that
the book made you take a closer look at Tapestry. This is the most wonderful
feadback. This is why I wrote the book. Thus it was worth to write it. :)

>
> One question I could not figure out from the book is a question
> regarding complex url redirects. With complex I mean injecting certain
> properties based on the url (like spring 3 supports with its
> requestmapping annotation and using expression language like
>
> @RequestMapping(value="/{tenant}/{user}/reservations/{id}",
> method=RequestMethod.GET)
>

URL rewrittng is indeed not covered by the book. It is not possible in
Tapestry to map different methods of a page to different paths. Event
handler path is an exception.

>
> Is is possible to do something like this with tapestry as well, like
> injecting the specific tenant, user and reservation into the page
> (which in this case means the user is dependant from the tenant and
> the reservation id from the user)?
>

As Thiago already pointed out, you can provide activation methods with
several params.

void onActivate(Tenant tenant, User user, Long id)

Is it what you are looking for?

>
> My first guess would be to write an own ComponentEventDispatcher for
> this, but any help or insight is greatly appreciated.
>
> Thanks and have a nice day!
>
>
> --Alexander
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>


-- 
Best regards,

Igor Drobiazko


About T5 IoC

2009-10-15 Thread Ding Zenberg
Hi All,

Is there a way to know a contribution object comes from which module?

Thanks


Zenberg Ding

-- 
Keep It Simple & Stupid.

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



Re: Login page - passing context between pages

2009-10-15 Thread DH
In that case, the context is only useful for Login page, but not the following 
page, so only returning logic name of source page would not carry the context.
Try PageRenderLinkSource#createPageRenderLinkWithContext(String pageName, 
Object... context) and return that link.

DH
http://www.gaonline.com.cn

- Original Message - 
From: "shymon" 
To: 
Sent: Thursday, October 15, 2009 7:35 PM
Subject: Login page - passing context between pages


> 
> 
> Some pages of my app are available only to authorized users. When user
> enters such a page and is not logged in, appropriate message is shown with
> link to login page. After logon user should return to the same page he came
> from to login page.
> 
> So I pass logical name of restricted page and it's context through context
> parameter of pageLink. In login page I use onActivate and onPassivate to
> maintain source page context. It works great, but when login is successful I
> return source page logical name which causes redirect, but rest of the page
> context is null. Simply onPassivate called after onSuccess returns array of
> nulls. (Inside onSuccess all variables are correctly set).
> 
> How can I store source page context through logon process?
> 
> -- 
> View this message in context: 
> http://www.nabble.com/Login-page---passing-context-between-pages-tp25907016p25907016.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: about tapestry ioc contribution

2009-10-15 Thread Thiago H. de Paula Figueiredo
Em Thu, 15 Oct 2009 22:44:12 -0300, <""Zenberg  
Ding"> escreveu:



Hi All,


Hi!


Is there a way to know a contribution object comes from which module?


As far as I know, no way to do it programatically.

--
Thiago H. de Paula Figueiredo
Independent Java consultant, developer, and instructor
http://www.arsmachina.com.br/thiago

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



Re: [Tapestry Central] Tapestry 5.1 and IE 8 -- Customizing Tapestry

2009-10-15 Thread Angelo Chen

Hi Thiago,

Thanis for the link, but I was interested in the using of Google's CDN
version of Prototype.js, of course T5's option to combine js into one file
is a good option as well.


Thiago H. de Paula Figueiredo wrote:
> 
> Em Thu, 15 Oct 2009 13:13:02 -0300, Angelo Chen  
>  escreveu:
> 
>> Any update on this ?
> 
> Have you seen http://www.nabble.com/Prototype-1.6.1-td25724717s302.html?
> 
> -- 
> Thiago H. de Paula Figueiredo
> Independent Java consultant, developer, and instructor
> http://www.arsmachina.com.br/thiago
> 
> -
> 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://www.nabble.com/-Tapestry-Central--Tapestry-5.1-and-IE-8Customizing-Tapestry-tp25729583p25918023.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: T5: Removing empty valued columns from grid

2009-10-15 Thread Thiago H. de Paula Figueiredo
Em Thu, 15 Oct 2009 20:02:31 -0300, Fermin Da Costa Gomez  
 escreveu:



Coming to think about it i have to rephrase my question to:
Is is possible to 'modify' the grid *after* the conduit has done its job,
ie. just prior to the actual rendering.


I guess not, but you can write a mixin to do that after the rendering,  
changing the generated DOM.



Tia = aunt in Portuguese. :P

So what do you guys use for Thanx in Advance .. aunt? .. ;-)


We use "Obrigado desde já". :)

I didn't know that acronym. I learned something new today. :P

--
Thiago H. de Paula Figueiredo
Independent Java consultant, developer, and instructor
http://www.arsmachina.com.br/thiago

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



Re: T5: Removing empty valued columns from grid

2009-10-15 Thread Fermin Da Costa Gomez
>
> My question is twofold:
>> 1. Can i modify the grid model (excluding columns) after its initial
>> creation, and
>>
>
> Yes. Just use beanModel.exclude();

I was that far .. ;-)

 2. If so, what would be the best place to do so?
>

When I need to manipulate the BeanModel, I create a BeanModel getBeanModel()
> method in my page class and add t:model="beanModel" in my Grid.
>
This i did as well.
I can get to the the model, fields etc.

The issue/challenge is the fact that only the conduit "really knows" which
fields are empty but it does its job on a per cell basis, if i'm right.
I suppose i could have a look at making sure all fields are in their final
phase before going into the conduit, but
Coming to think about it i have to rephrase my question to:
Is is possible to 'modify' the grid *after* the conduit has done its job,
ie. just prior to the actual rendering.
If a columnwas created that contained unwanted entries this would be the
only point remove whole columns ... or?

Tia = aunt in Portuguese. :P
>
So what do you guys use for Thanx in Advance .. aunt? .. ;-)



Fermin Da Costa Gomez

-- 
“The reasonable man adapts himself to the world; the unreasonable one
persists in trying to adapt the world to himself. Therefore all progress
depends on the unreasonable man.”
- George Bernard Shaw (1856 - 1950)


Re: T5: Removing empty valued columns from grid

2009-10-15 Thread Thiago H. de Paula Figueiredo
Em Thu, 15 Oct 2009 19:12:40 -0300, Fermin Da Costa Gomez  
 escreveu:



Hi,


Olá! :)


My question is twofold:
1. Can i modify the grid model (excluding columns) after its initial
creation, and


Yes. Just use beanModel.exclude();


2. If so, what would be the best place to do so?


When I need to manipulate the BeanModel, I create a BeanModel  
getBeanModel() method in my page class and add t:model="beanModel" in my  
Grid.



Tia,


Tia = aunt in Portuguese. :P

--
Thiago H. de Paula Figueiredo
Independent Java consultant, developer, and instructor
http://www.arsmachina.com.br/thiago

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



T5: Removing empty valued columns from grid

2009-10-15 Thread Fermin Da Costa Gomez
Hi,

I'm looking for a piece of advice/suggestion on the best way to handle the
following.

Using Lucene i generate a searchResult list, in which each searchResult
entry contains a (Lucene)Document. These results wil be displayed in a grid.
Since i cannot determine beforehand which columns (read fields) i will be
receiving i put together my own model and conduit (as per example on the
list somewhere).
So far so good, i'm getting the results i'm looking for.

Final tweak concerns the elimination of the columns without any values.
Obviously this needs to be done prior to rendering but after the results
have been obtained.

My question is twofold:
1. Can i modify the grid model (excluding columns) after its initial
creation, and
2. If so, what would be the best place to do so?

Tia,

Fermin Da Costa Gomez


Re: Question regarding complex URL rewriting and injecting

2009-10-15 Thread Thiago H. de Paula Figueiredo
Em Thu, 15 Oct 2009 18:11:04 -0300, Alexander Reelsen   
escreveu:



Hi,


Hi!


One question I could not figure out from the book is a question
regarding complex url redirects. With complex I mean injecting certain
properties based on the url (like spring 3 supports with its
requestmapping annotation and using expression language like


Tapestry supports URL rewriting out-of-the-box:  
http://tapestry.apache.org/tapestry5.1/guide/url-rewriting.html. Of  
course, you'll need to provide the rewriting logic, and Tapestry does the  
rest.


But what you're describing seems to be more related to activation context  
than URL rewriting itself.



Is is possible to do something like this with tapestry as well, like
injecting the specific tenant, user and reservation into the page
(which in this case means the user is dependant from the tenant and
the reservation id from the user)?


This looks like the activation context:  
http://tapestry.apache.org/tapestry5.1/guide/pagenav.html, session Page  
Activation.


--
Thiago H. de Paula Figueiredo
Independent Java consultant, developer, and instructor
http://www.arsmachina.com.br/thiago

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



Question regarding complex URL rewriting and injecting

2009-10-15 Thread Alexander Reelsen
Hi,

after reading the new german book on Tapestry I am thinking to take a
closer look at it. It is a very nice and clean structured book, which
can be read quite easily at a rainy weekend. Very well done.

One question I could not figure out from the book is a question
regarding complex url redirects. With complex I mean injecting certain
properties based on the url (like spring 3 supports with its
requestmapping annotation and using expression language like

@RequestMapping(value="/{tenant}/{user}/reservations/{id}",
method=RequestMethod.GET)

Is is possible to do something like this with tapestry as well, like
injecting the specific tenant, user and reservation into the page
(which in this case means the user is dependant from the tenant and
the reservation id from the user)?

My first guess would be to write an own ComponentEventDispatcher for
this, but any help or insight is greatly appreciated.

Thanks and have a nice day!


--Alexander

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



Re: DDOS emergency button for Tapestry 5?

2009-10-15 Thread Sebastian Hennebrueder
Depending on the serverity of the attack, you will need to to do this in 
the network layer as higher layers can not sustain much load.

Assuming a Linux based server, this can be done with iptables.

The idea with the author cookie is nice but keep in mind that you need 
to be able to login as well (without cookie). You need to disable DOS 
protection for the login, which leaves a door for DOS.


Best Regards

Sebastian Hennebrueder

Andreas Andreou schrieb:

i'd also recommend Sergey's suggestion - it also frees up
app server resources/threads since the app server won't need to wait
for clients to get all the bytes of each response.

On Wed, Oct 14, 2009 at 11:03 PM, Sergey Didenko
 wrote:

It is more effective to use reverse proxy like nginx as a frontend.
And use it to cut ddos requests.

You will need to setup it with a rule like "if the request does not
contain auth cookie - send error.html ". May be more complex one
because this can be hijacked with a fake cookie.

Even more effective ways are to somehow identify bad requests and cut
them with firewall or even router.

On Wed, Oct 14, 2009 at 3:30 PM, Mats Henricson  wrote:

Hi!

Hi!

Hi!

You Tapestry guys are slow today. It took a whopping 8 minutes to
get an answer... ;-)


So, what would you guys do? Is there a simpler solution? A filter?

I would use a ResquestFilter or a Dispatcher checking some service (that
would hold the underDDoS field) and redirecting to a given page when
needed.

Thanks a lot! I'll look at it!

Mats


-
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










--
Best Regards / Viele Grüße

Sebastian Hennebrueder
-
Software Developer and Trainer for Hibernate / Java Persistence
http://www.laliluna.de



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



RE: T5: t:delegate and component recursion emulation

2009-10-15 Thread Dirk Lattermann
Am Donnerstag, den 15.10.2009, 11:32 +0100 schrieb Alfie Kirkpatrick:
> I can't comment in detail on your solution but it looks a bit convoluted
> in the TML for my liking. A tree should be a first class component and
> in this case I am prepared to do a little more work in the component
> class to make it simple and intuitive to use.

Hi Alfie!

Thank you for your thoughts and code. Meanwhile I think you are right,
using a template is not very helpful as it is not easily maintainable
anyway.

I found out what's the problem with the If component that "are only
evaluated once": the If component object is also re-used at every
recursion level, and their "test" parameter is cached, so they will
yield always the same result instead of recalculating it with a new test
value. As this will be the case for most standard components that could
be used to customize the tml, they are not usable in a situation like I
was trying to set up. So, one would have to rewrite all used components
to not cache their parameters which wouldn't be very practical, as it
will make a mess in the tml part.

I already had a tree component using a MarkupWriter that was nearly
identical to the code you sent (thanks again!), the only difference was
the move_next method wasn't recursive but iterative. I think I will make
the component produce / elements with the values of their
"class" attributes configurable via a parameter. That should be enough
of configurability.

Regards, Dirk


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



Re: Tapestry5 - Helloworld

2009-10-15 Thread Borut Bolčina
Hi,

try this
http://bbwebcraft.blogspot.com/2008/12/task-1-create-skeleton-tapestry-5.html

Tapestry, Maven and m2eclipse plugin have all progressed to newer version,
but the procedure is still very much the same.

Cheers,
Borut


2009/10/15 vhtien 

>
> Hi everyone!
>
> I'm very tired! I'm exhauted! I've try many solution but i do not write and
> deploy a simple Tapestry5 project HelloWorld. I never pass the maven task,
> just ERROR or FAILURE. I want to cry.
>
> Someone show me how to do it step by step ??
>
> My OSs is Fedora 10, my IDE is Eclipse 3.5. Thanks.
> --
> View this message in context:
> http://www.nabble.com/Tapestry5---Helloworld-tp25903419p25903419.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: Lifecycle of a tapestry request and the MarkupRendererFilter

2009-10-15 Thread Ulrich Stärk
http://tapestry.formos.com/nightly/tapestry5/guide/request.html gives an 
overview of how a request goes through the various pipelines and 
dispatchers.


Uli

Ian Petzer schrieb:

Hi,

 


I have been successfully using the CacheControlMarkupRenderer from the
ioko-tapestry-commons
  library.
This is a java class that implements the MarkupRendererFilter and
Partial MarkupRendererFilter in order to apply caching headers to pages
served by our application.

 


This is all working wonderfully, however we now have a component which
is returning a StreamResponse object out of the onActivate method of the
component. This of course does not invoke the renderMarkup(MarkupWriter
writer, MarkupRenderer renderer) method on the
CacheControlMarkupRenderer as it is not markup.

 


Is there an equivalent filter we could use that would enable us to set
headers on the Response object but would be applied to both
StreamResponse objects as well as the output from normal components with
markup in a tml file.

 


Thanks,

Ian





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



Re: [ANNOUNCE] ChenilleKit 1.2.0 RELEASE

2009-10-15 Thread Marcus Veloso
Hi Massimo,
Congratulations to CK team!
ChenilleKit is great!

I'm using chenillekit-access 1.0.2. It works perfectly.
In the release 1.2.0 the WebSessionUser interface has changed. My project is
not working anymore, and the CK site (
http://chenillekit.codehaus.org/chenillekit-access/usage.html) is not
updated.
Where can i get updated information about CK-access 1.2.0?

Thanks,

Marcus


Re: [Tapestry Central] Tapestry 5.1 and IE 8 -- Customizing Tapestry

2009-10-15 Thread Thiago H. de Paula Figueiredo
Em Thu, 15 Oct 2009 13:13:02 -0300, Angelo Chen  
 escreveu:



Any update on this ?


Have you seen http://www.nabble.com/Prototype-1.6.1-td25724717s302.html?

--
Thiago H. de Paula Figueiredo
Independent Java consultant, developer, and instructor
http://www.arsmachina.com.br/thiago

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



Re: Tapestry5 - Helloworld

2009-10-15 Thread Ben Acker

Howdy!

After reading this I thought of another easy way to do this.

If you have the Maven plugin installed into Eclipse you can create a  
new project and create it directly from the Tapestry Quickstart  
Archetype.


In Eclipse select File - > New -> Other -> Maven -> Maven Project

It will ask you information about your project and then give you a  
list of catalogs from which you can select an archetype.


Add this Catalog to your list: http://tapestry.formos.com/maven-repository

That will give you the T5 quickstart, select it and enter the info for  
your project (Group ID and Artifact ID).


Hopefully this helps! If either of these solutions don't work, let us  
know what your errors are; maybe we can help there.


regards,

Ben


On Oct 15, 2009, at 9:14 AM, tapestryfan wrote:



Hi,

When I make my first tapestry project I was struckling with it too.  
But here
are some hints which can be helpfull for you. ( I am using eclipse  
3.5 on

redhat linux)

I presume you understand how to use eclipse and install plugins.

1. Install the mave plugin in eclipse. It can be fond at
http://m2eclipse.sonatype.org/update/
2. Create a Java project
3. Right click the project node and select mave / enable dependancies
management
4. Enter some values and select 'war file' by packaging
5. Add the tapestry5 core jar on the add additional dependancie tab  
page and

click finish

Now create your directory structure

on the src folder click add new folder (you must do it 3 times)

folder 1 : enter main/webpapp/WEB-INF
folder 2 : enter main/java
folder 3 : enter main/resources

add the src/main/java as your sources folder bij properties java
add the src/main/resources as classpath bij properties/java/libraries

create a new java package : for example org.myapp.pages
create under directory src/main/resources new folder with :  
org.myapp.pages


create your Start.tml in the org.myapp.pages folder
create your Start.java in package org.myapp.pages

create new file under webapp/WEB-INF. This file must be web.xml

copy and paste the example of the web.xml from apache tapestry website
located on http://tapestry.apache.org/tapestry5/guide/conf.html

change org.example.myapp to
org.myapp

Save everything

I use mave/package to build a war file and deploy it on tomcat. Some  
people
have jetty running within eclipse but i haven't got this working  
properly.


I hope this is a little help to you

regards

Johan

If you still have problems I can sent you an example of a simple  
tapestry5

project



vhtien wrote:


Hi everyone!

I'm very tired! I'm exhauted! I've try many solution but i do not  
write
and deploy a simple Tapestry5 project HelloWorld. I never pass the  
maven

task, just ERROR or FAILURE. I want to cry.

Someone show me how to do it step by step ??

My OSs is Fedora 10, my IDE is Eclipse 3.5. Thanks.



--
View this message in context: 
http://www.nabble.com/Tapestry5---Helloworld-tp25903419p25911539.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: Parameter value was null or contained only whitespace

2009-10-15 Thread Thiago H. de Paula Figueiredo

Em Thu, 15 Oct 2009 10:49:41 -0300, blueboy6  escreveu:


I have same problem,
I mean not same but problem is that


This is another problem, so please post new questions in new threads.


request.getQueryString() is null


I tried this code in a page:

@Inject
private HttpServletRequest request;

void onActivate() {
System.out.println(request.getQueryString());
}

It works perfectly.

--
Thiago H. de Paula Figueiredo
Independent Java consultant, developer, and instructor
http://www.arsmachina.com.br/thiago

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



Re: T5 / Include file ordering

2009-10-15 Thread Gunnar Eketrapp
Ok!

Since I am including the main css from my border component it will be
included after any page spec. includes.

One cure would be to remove the include of the main css from the border
component and move it into the base page class.

I'll try that ...

/Gunnar


2009/10/15 Martin Reurings 

> TBH, a 'component' css-file should never be included before the 'main' css,
> that would make absolutely no sense! The idea suggests that the global css
> is more important than the specific css for a particular component!?!?
>
> But, if you really want to do so anyway, @Inject
> org.apache.tapestry5.RenderSupport and in any phase that runs after the body
> is rendered (@AfterBody for instance) user rendersupport to add the
> stylesheet. Not pretty, but it works :) I still remember when I used this
> because there was no annotation for adding stylesheets ;)
>
> Cheers,
>
> Martin
>
>
> Gunnar Eketrapp wrote:
>
>> With an annotaion in the border component class.
>>
>> E.g.
>>
>> @IncludeStylesheet("context:layout/css/main.css")
>>
>> ... and the page specific as an annotion in the page class ...
>>
>> E.g.
>> @IncludeStylesheet("context:css/page.css")
>>
>>
>> 2009/10/15 cordenier christophe 
>>
>>
>>
>>> Hello
>>> How do you include the main css file ?
>>>
>>> Regards
>>> Christophe.
>>>
>>> 2009/10/15 Gunnar Eketrapp 
>>>
>>>
>>>
 Please anyone!

 My T5'ed version of the page differs from the HTML designers version and


>>> I
>>>
>>>
 really suspect the ordering of the CSS includes to be the reason.

 So how do I add a page specific CSS include after the border component
 includes.

 Or am I stupid?

 Thanks in advance!


 2009/10/15 Gunnar Eketrapp 



> Hi!
>
> I am porting an app that have some page specific CSS files.
>
> I added these in the page class files as 
>
> @IncludeStylesheet
>
> ... annotations.
>
> I also have a border component that includes the main CSS file.
>
> My question now is how do I get the main CSS to be loaded before the
>
>
 page
>>>
>>>
 specific CSS.
>
>
> 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: Tapestry5 - Helloworld

2009-10-15 Thread tapestryfan

Hi,

When I make my first tapestry project I was struckling with it too. But here
are some hints which can be helpfull for you. ( I am using eclipse 3.5 on
redhat linux)

I presume you understand how to use eclipse and install plugins.

1. Install the mave plugin in eclipse. It can be fond at
http://m2eclipse.sonatype.org/update/
2. Create a Java project
3. Right click the project node and select mave / enable dependancies
management
4. Enter some values and select 'war file' by packaging
5. Add the tapestry5 core jar on the add additional dependancie tab page and
click finish

Now create your directory structure

on the src folder click add new folder (you must do it 3 times)

folder 1 : enter main/webpapp/WEB-INF
folder 2 : enter main/java
folder 3 : enter main/resources

add the src/main/java as your sources folder bij properties java
add the src/main/resources as classpath bij properties/java/libraries

create a new java package : for example org.myapp.pages
create under directory src/main/resources new folder with : org.myapp.pages

create your Start.tml in the org.myapp.pages folder
create your Start.java in package org.myapp.pages

create new file under webapp/WEB-INF. This file must be web.xml

copy and paste the example of the web.xml from apache tapestry website
located on http://tapestry.apache.org/tapestry5/guide/conf.html

change org.example.myapp to
org.myapp

Save everything

I use mave/package to build a war file and deploy it on tomcat. Some people
have jetty running within eclipse but i haven't got this working properly.

I hope this is a little help to you

regards

Johan

If you still have problems I can sent you an example of a simple tapestry5
project



vhtien wrote:
> 
> Hi everyone!
> 
> I'm very tired! I'm exhauted! I've try many solution but i do not write
> and deploy a simple Tapestry5 project HelloWorld. I never pass the maven
> task, just ERROR or FAILURE. I want to cry. 
> 
> Someone show me how to do it step by step ?? 
> 
> My OSs is Fedora 10, my IDE is Eclipse 3.5. Thanks.
> 

-- 
View this message in context: 
http://www.nabble.com/Tapestry5---Helloworld-tp25903419p25911539.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: [Tapestry Central] Tapestry 5.1 and IE 8 -- Customizing Tapestry

2009-10-15 Thread Angelo Chen

Any update on this ?

Sergey Didenko wrote:
> 
> Thanks. I'm planning to make it in the future.
> 
>>> BTW, is there a simple way to change the bundled Prototype for Google
>>> CDN's one? (
>>> http://ajax.googleapis.com/ajax/libs/prototype/1.6.1/prototype.js
>>> )
>>
>> Not a simple way, as that would defeat Tapestry's JavaScript aggegation.
>>
>>>
> 
> -
> 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://www.nabble.com/-Tapestry-Central--Tapestry-5.1-and-IE-8Customizing-Tapestry-tp25729583p25911508.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: T5 / Include file ordering

2009-10-15 Thread Martin Reurings
TBH, a 'component' css-file should never be included before the 'main' 
css, that would make absolutely no sense! The idea suggests that the 
global css is more important than the specific css for a particular 
component!?!?


But, if you really want to do so anyway, @Inject 
org.apache.tapestry5.RenderSupport and in any phase that runs after the 
body is rendered (@AfterBody for instance) user rendersupport to add the 
stylesheet. Not pretty, but it works :) I still remember when I used 
this because there was no annotation for adding stylesheets ;)


Cheers,

Martin

Gunnar Eketrapp wrote:

With an annotaion in the border component class.

E.g.

@IncludeStylesheet("context:layout/css/main.css")

... and the page specific as an annotion in the page class ...

E.g.
@IncludeStylesheet("context:css/page.css")


2009/10/15 cordenier christophe 

  

Hello
How do you include the main css file ?

Regards
Christophe.

2009/10/15 Gunnar Eketrapp 



Please anyone!

My T5'ed version of the page differs from the HTML designers version and
  

I


really suspect the ordering of the CSS includes to be the reason.

So how do I add a page specific CSS include after the border component
includes.

Or am I stupid?

Thanks in advance!


2009/10/15 Gunnar Eketrapp 

  

Hi!

I am porting an app that have some page specific CSS files.

I added these in the page class files as 

@IncludeStylesheet

... annotations.

I also have a border component that includes the main CSS file.

My question now is how do I get the main CSS to be loaded before the


page


specific CSS.


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 / Include file ordering

2009-10-15 Thread Gunnar Eketrapp
With an annotaion in the border component class.

E.g.

@IncludeStylesheet("context:layout/css/main.css")

... and the page specific as an annotion in the page class ...

E.g.
@IncludeStylesheet("context:css/page.css")


2009/10/15 cordenier christophe 

> Hello
> How do you include the main css file ?
>
> Regards
> Christophe.
>
> 2009/10/15 Gunnar Eketrapp 
>
> > Please anyone!
> >
> > My T5'ed version of the page differs from the HTML designers version and
> I
> > really suspect the ordering of the CSS includes to be the reason.
> >
> > So how do I add a page specific CSS include after the border component
> > includes.
> >
> > Or am I stupid?
> >
> > Thanks in advance!
> >
> >
> > 2009/10/15 Gunnar Eketrapp 
> >
> > > Hi!
> > >
> > > I am porting an app that have some page specific CSS files.
> > >
> > > I added these in the page class files as 
> > >
> > > @IncludeStylesheet
> > >
> > > ... annotations.
> > >
> > > I also have a border component that includes the main CSS file.
> > >
> > > My question now is how do I get the main CSS to be loaded before the
> page
> > > specific CSS.
> > >
> > >
> > > 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: Lifecycle of a tapestry request and the MarkupRendererFilter

2009-10-15 Thread Ian Petzer
Hi,

This is exactly how I am currently setting the headers, however I don't
want to do this on an individual basis for all StreamResponses. 

What I'm looking for a is a filter or similar mechanism that can be used
to post-process all responses irrespective of whether they are
StreamResponse objects or the output from normal components with markup
in a tml file. Essentially a filter like the MarkupRendererFilter that
works on StreamResponses as well

Thanks
Ian



-Original Message-
From: cordenier christophe [mailto:christophe.corden...@gmail.com] 
Sent: 15 October 2009 15:31
To: Tapestry users
Subject: Re: Lifecycle of a tapestry request and the
MarkupRendererFilter

What not using the prepareResponse of the StreamResponse Tapestry
interface
to set headers ?

2009/10/15 Ian Petzer 

> Hi,
>
> We do actually have a load balanced caching system sitting in front
our
> app server, however we control the caching behaviour by setting
headers
> on the HTTP responses.
>
> For example in this particular case we need to set:
>
response.setHeader(CACHE_CONTROL_HEADER,
> "no-cache");
>response.setHeader(PRAGMA_HEADER,
> "No-Cache");
>
>
>
>
>
> -Original Message-
> From: cordenier christophe [mailto:christophe.corden...@gmail.com]
> Sent: 15 October 2009 14:58
> To: Tapestry users
> Subject: Re: Lifecycle of a tapestry request and the
> MarkupRendererFilter
>
> Hello
> From my point of view this kind of caching mechanism should be done in
> front
> of your application server.
>
> Regards
> Christophe.
>
> 2009/10/15 Ian Petzer 
>
> > Hi,
> >
> >
> >
> > I have been successfully using the CacheControlMarkupRenderer from
the
> > ioko-tapestry-commons
> > 
library.
> > This is a java class that implements the MarkupRendererFilter and
> > Partial MarkupRendererFilter in order to apply caching headers to
> pages
> > served by our application.
> >
> >
> >
> > This is all working wonderfully, however we now have a component
which
> > is returning a StreamResponse object out of the onActivate method of
> the
> > component. This of course does not invoke the
> renderMarkup(MarkupWriter
> > writer, MarkupRenderer renderer) method on the
> > CacheControlMarkupRenderer as it is not markup.
> >
> >
> >
> > Is there an equivalent filter we could use that would enable us to
set
> > headers on the Response object but would be applied to both
> > StreamResponse objects as well as the output from normal components
> with
> > markup in a tml file.
> >
> >
> >
> > Thanks,
> >
> > Ian
> >
> >
>
> -
> 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: Lifecycle of a tapestry request and the MarkupRendererFilter

2009-10-15 Thread cordenier christophe
What not using the prepareResponse of the StreamResponse Tapestry interface
to set headers ?

2009/10/15 Ian Petzer 

> Hi,
>
> We do actually have a load balanced caching system sitting in front our
> app server, however we control the caching behaviour by setting headers
> on the HTTP responses.
>
> For example in this particular case we need to set:
>response.setHeader(CACHE_CONTROL_HEADER,
> "no-cache");
>response.setHeader(PRAGMA_HEADER,
> "No-Cache");
>
>
>
>
>
> -Original Message-
> From: cordenier christophe [mailto:christophe.corden...@gmail.com]
> Sent: 15 October 2009 14:58
> To: Tapestry users
> Subject: Re: Lifecycle of a tapestry request and the
> MarkupRendererFilter
>
> Hello
> From my point of view this kind of caching mechanism should be done in
> front
> of your application server.
>
> Regards
> Christophe.
>
> 2009/10/15 Ian Petzer 
>
> > Hi,
> >
> >
> >
> > I have been successfully using the CacheControlMarkupRenderer from the
> > ioko-tapestry-commons
> >   library.
> > This is a java class that implements the MarkupRendererFilter and
> > Partial MarkupRendererFilter in order to apply caching headers to
> pages
> > served by our application.
> >
> >
> >
> > This is all working wonderfully, however we now have a component which
> > is returning a StreamResponse object out of the onActivate method of
> the
> > component. This of course does not invoke the
> renderMarkup(MarkupWriter
> > writer, MarkupRenderer renderer) method on the
> > CacheControlMarkupRenderer as it is not markup.
> >
> >
> >
> > Is there an equivalent filter we could use that would enable us to set
> > headers on the Response object but would be applied to both
> > StreamResponse objects as well as the output from normal components
> with
> > markup in a tml file.
> >
> >
> >
> > Thanks,
> >
> > Ian
> >
> >
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>


RE: Lifecycle of a tapestry request and the MarkupRendererFilter

2009-10-15 Thread Ian Petzer
Hi,

We do actually have a load balanced caching system sitting in front our
app server, however we control the caching behaviour by setting headers
on the HTTP responses.

For example in this particular case we need to set:
response.setHeader(CACHE_CONTROL_HEADER,
"no-cache");
response.setHeader(PRAGMA_HEADER,
"No-Cache");





-Original Message-
From: cordenier christophe [mailto:christophe.corden...@gmail.com] 
Sent: 15 October 2009 14:58
To: Tapestry users
Subject: Re: Lifecycle of a tapestry request and the
MarkupRendererFilter

Hello
>From my point of view this kind of caching mechanism should be done in
front
of your application server.

Regards
Christophe.

2009/10/15 Ian Petzer 

> Hi,
>
>
>
> I have been successfully using the CacheControlMarkupRenderer from the
> ioko-tapestry-commons
>   library.
> This is a java class that implements the MarkupRendererFilter and
> Partial MarkupRendererFilter in order to apply caching headers to
pages
> served by our application.
>
>
>
> This is all working wonderfully, however we now have a component which
> is returning a StreamResponse object out of the onActivate method of
the
> component. This of course does not invoke the
renderMarkup(MarkupWriter
> writer, MarkupRenderer renderer) method on the
> CacheControlMarkupRenderer as it is not markup.
>
>
>
> Is there an equivalent filter we could use that would enable us to set
> headers on the Response object but would be applied to both
> StreamResponse objects as well as the output from normal components
with
> markup in a tml file.
>
>
>
> Thanks,
>
> Ian
>
>

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



Re: T5 / Include file ordering

2009-10-15 Thread cordenier christophe
Hello
How do you include the main css file ?

Regards
Christophe.

2009/10/15 Gunnar Eketrapp 

> Please anyone!
>
> My T5'ed version of the page differs from the HTML designers version and I
> really suspect the ordering of the CSS includes to be the reason.
>
> So how do I add a page specific CSS include after the border component
> includes.
>
> Or am I stupid?
>
> Thanks in advance!
>
>
> 2009/10/15 Gunnar Eketrapp 
>
> > Hi!
> >
> > I am porting an app that have some page specific CSS files.
> >
> > I added these in the page class files as 
> >
> > @IncludeStylesheet
> >
> > ... annotations.
> >
> > I also have a border component that includes the main CSS file.
> >
> > My question now is how do I get the main CSS to be loaded before the page
> > specific CSS.
> >
> >
> > 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 / Include file ordering

2009-10-15 Thread Gunnar Eketrapp
Please anyone!

My T5'ed version of the page differs from the HTML designers version and I
really suspect the ordering of the CSS includes to be the reason.

So how do I add a page specific CSS include after the border component
includes.

Or am I stupid?

Thanks in advance!


2009/10/15 Gunnar Eketrapp 

> Hi!
>
> I am porting an app that have some page specific CSS files.
>
> I added these in the page class files as 
>
> @IncludeStylesheet
>
> ... annotations.
>
> I also have a border component that includes the main CSS file.
>
> My question now is how do I get the main CSS to be loaded before the page
> specific CSS.
>
>
> Thanks in advance,
> Gunnar Eketrapp
>
>


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


Re: Lifecycle of a tapestry request and the MarkupRendererFilter

2009-10-15 Thread cordenier christophe
Hello
>From my point of view this kind of caching mechanism should be done in front
of your application server.

Regards
Christophe.

2009/10/15 Ian Petzer 

> Hi,
>
>
>
> I have been successfully using the CacheControlMarkupRenderer from the
> ioko-tapestry-commons
>   library.
> This is a java class that implements the MarkupRendererFilter and
> Partial MarkupRendererFilter in order to apply caching headers to pages
> served by our application.
>
>
>
> This is all working wonderfully, however we now have a component which
> is returning a StreamResponse object out of the onActivate method of the
> component. This of course does not invoke the renderMarkup(MarkupWriter
> writer, MarkupRenderer renderer) method on the
> CacheControlMarkupRenderer as it is not markup.
>
>
>
> Is there an equivalent filter we could use that would enable us to set
> headers on the Response object but would be applied to both
> StreamResponse objects as well as the output from normal components with
> markup in a tml file.
>
>
>
> Thanks,
>
> Ian
>
>


Re: Parameter value was null or contained only whitespace

2009-10-15 Thread blueboy6

I have same problem,

I mean not same but problem is that

request.getQueryString() is null

And I have query parameters

I think this is new T5.1 issue!

CAN SOMEBODY HELP





Ulrich Stärk wrote:
> 
> This is really weird. Somehow Tapestry thinks that the actionlink is
> referring to a component placed 
> on another page than the one that is rendering. And since it thinks the
> containing page is the index 
> page, it converts the page name to the empty string "" which is not
> allowed as a value for a paramater.
> 
> I'm confused.
> 
> Uli
> 
> Am 15.10.2009 11:25 schrieb Borut Bolčina:
>> Here it is (also in attachment, if it gets through)
>> 
>> 
>>   An unexpected application exception has occurred.
>> 
>> * org.apache.tapestry5.internal.services.RenderQueueException
>>   Render queue error in BeginRender[Index:logout]: Parameter value
>>   was null or contained only whitespace.
>> 
>>   activeComponents
>>   o Verify (class si.najdi.rp.pages.Verify)
>>   o Index (class si.najdi.rp.pages.Index)
>>   o Index:layout (class si.najdi.rp.components.Layout)
>> context:Index.tml, line 1
>> 1> 2t:sidebarTitle="OpenID response"
>> 3
>>
>> xmlns:t="http://tapestry.apache.org/schema/tapestry_5_1_0.xsd";
>> 4xmlns:p="tapestry:parameter">
>> 5
>> 6${message:greeting}
>> 
>>   o Index:if (class
>> org.apache.tapestry5.corelib.components.If)
>> context:Index.tml, line 8
>> 3
>>
>> xmlns:t="http://tapestry.apache.org/schema/tapestry_5_1_0.xsd";
>> 4xmlns:p="tapestry:parameter">
>> 5
>> 6${message:greeting}
>> 7
>> 8
>> 9Welcome, ${user.firstName} | > t:id="logout">logout
>> 10   
>> 11   
>> 12   
>> 13   :
>> 
>>   o Index:logout (class
>> org.apache.tapestry5.corelib.components.ActionLink)
>> context:Index.tml, line 9
>> 4xmlns:p="tapestry:parameter">
>> 5
>> 6${message:greeting}
>> 7
>> 8
>> 9Welcome, ${user.firstName} | > t:id="logout">logout
>> 10   
>> 11   
>> 12   
>> 13   :
>> 14   
>> 
>>   location
>>   context:Index.tml, line 9
>> 
>> * java.lang.IllegalArgumentException
>>   Parameter value was null or contained only whitespace.
>> 
>>   Hide uninteresting stack frames Stack trace
>>   o
>> org.apache.tapestry5.ioc.internal.util.Defense.notBlank(Defense.java:59)
>> 
>>   o
>> org.apache.tapestry5.internal.services.LinkImpl.addParameter(LinkImpl.java:55)
>> 
>>   o
>> org.apache.tapestry5.internal.services.ComponentEventLinkEncoderImpl.createComponentEventLink(ComponentEventLinkEncoderImpl.java:212)
>> 
>>   o
>> $ComponentEventLinkEncoder_124571f880c.createComponentEventLink($ComponentEventLinkEncoder_124571f880c.java)
>> 
>>   o
>> org.apache.tapestry5.internal.services.LinkSourceImpl.createComponentEventLink(LinkSourceImpl.java:79)
>> 
>>   o
>> $LinkSource_124571f881c.createComponentEventLink($LinkSource_124571f881c.java)
>> 
>>   o
>> org.apache.tapestry5.internal.structure.ComponentPageElementResourcesImpl.createComponentEventLink(ComponentPageElementResourcesImpl.java:94)
>> 
>>   o
>> org.apache.tapestry5.internal.structure.ComponentPageElementImpl.createEventLink(ComponentPageElementImpl.java:1204)
>> 
>>   o
>> org.apache.tapestry5.internal.structure.InternalComponentResourcesImpl.createEventLink(InternalComponentResourcesImpl.java:173)
>> 
>>   o
>> org.apache.tapestry5.corelib.components.ActionLink.createLink(ActionLink.java:36)
>> 
>>   o
>> org.apache.tapestry5.corelib.base.AbstractComponentEventLink.beginRender(AbstractComponentEventLink.java:57)
>> 
>>   o
>> org.apache.tapestry5.corelib.base.AbstractComponentEventLink.beginRender(AbstractComponentEventLink.java)
>> 
>>   o
>> org.apache.tapestry5.internal.structure.ComponentPageElementImpl$BeginRenderPhase.invokeComponent(ComponentPageElementImpl.java:206)
>> 
>>   o
>> org.apache.tapestry5.internal.structure.ComponentPageElementImpl$AbstractPhase.run(ComponentPageElementImpl.java:164)
>> 
>>   o
>> org.apache.tapestry5.internal.structure.ComponentPageElementImpl.invoke(ComponentPageElementImpl.java:933)
>> 
>>   o
>> org.apache.tapestry5.internal.structure.ComponentPageElementImpl.access$400(ComponentPageElementIm

Lifecycle of a tapestry request and the MarkupRendererFilter

2009-10-15 Thread Ian Petzer
Hi,

 

I have been successfully using the CacheControlMarkupRenderer from the
ioko-tapestry-commons
  library.
This is a java class that implements the MarkupRendererFilter and
Partial MarkupRendererFilter in order to apply caching headers to pages
served by our application.

 

This is all working wonderfully, however we now have a component which
is returning a StreamResponse object out of the onActivate method of the
component. This of course does not invoke the renderMarkup(MarkupWriter
writer, MarkupRenderer renderer) method on the
CacheControlMarkupRenderer as it is not markup.

 

Is there an equivalent filter we could use that would enable us to set
headers on the Response object but would be applied to both
StreamResponse objects as well as the output from normal components with
markup in a tml file.

 

Thanks,

Ian



Re: "component must be enclosed by a Form component" error

2009-10-15 Thread Lindsay Ridgeway

Yes, Christophe, that resolved it.  Thanks!

--Lindsay


cordenier christophe wrote:
> 
> I think this is caused by 'inPlace=true'.
> 

-- 
View this message in context: 
http://www.nabble.com/%22component-must-be-enclosed-by-a-Form-component%22-error-tp25902660p25908839.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: Tapestry 5 Submit Form from Javascript

2009-10-15 Thread Thiago H. de Paula Figueiredo
Em Wed, 14 Oct 2009 23:04:12 -0300, Martin Strand  
 escreveu:


Had you used  and  Tapestry would simply have  
rendered the html as you wrote it but there would be no integration with  
your server side code and any submitted data would have been sent off to  
the far reaches of cyberspace. ;)


You can get their values injecting Request and then using  
request.getParameter(String parameterName).


--
Thiago H. de Paula Figueiredo
Independent Java consultant, developer, and instructor
http://www.arsmachina.com.br/thiago

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



Login page - passing context between pages

2009-10-15 Thread shymon


Some pages of my app are available only to authorized users. When user
enters such a page and is not logged in, appropriate message is shown with
link to login page. After logon user should return to the same page he came
from to login page.

So I pass logical name of restricted page and it's context through context
parameter of pageLink. In login page I use onActivate and onPassivate to
maintain source page context. It works great, but when login is successful I
return source page logical name which causes redirect, but rest of the page
context is null. Simply onPassivate called after onSuccess returns array of
nulls. (Inside onSuccess all variables are correctly set).

How can I store source page context through logon process?

-- 
View this message in context: 
http://www.nabble.com/Login-page---passing-context-between-pages-tp25907016p25907016.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: Parameter value was null or contained only whitespace

2009-10-15 Thread Ulrich Stärk
This is really weird. Somehow Tapestry thinks that the actionlink is referring to a component placed 
on another page than the one that is rendering. And since it thinks the containing page is the index 
page, it converts the page name to the empty string "" which is not allowed as a value for a paramater.


I'm confused.

Uli

Am 15.10.2009 11:25 schrieb Borut Bolčina:

Here it is (also in attachment, if it gets through)


  An unexpected application exception has occurred.

* org.apache.tapestry5.internal.services.RenderQueueException
  Render queue error in BeginRender[Index:logout]: Parameter value
  was null or contained only whitespace.

  activeComponents
  o Verify (class si.najdi.rp.pages.Verify)
  o Index (class si.najdi.rp.pages.Index)
  o Index:layout (class si.najdi.rp.components.Layout)
context:Index.tml, line 1
1   http://tapestry.apache.org/schema/tapestry_5_1_0.xsd";
4   xmlns:p="tapestry:parameter">
5   
6   ${message:greeting}

  o Index:if (class org.apache.tapestry5.corelib.components.If)
context:Index.tml, line 8
3
xmlns:t="http://tapestry.apache.org/schema/tapestry_5_1_0.xsd";
4   xmlns:p="tapestry:parameter">
5   
6   ${message:greeting}
7   
8   
9   Welcome, ${user.firstName} | logout
10  
11  
12  
13  :

  o Index:logout (class
org.apache.tapestry5.corelib.components.ActionLink)
context:Index.tml, line 9
4   xmlns:p="tapestry:parameter">
5   
6   ${message:greeting}
7   
8   
9   Welcome, ${user.firstName} | logout
10  
11  
12  
13  :
14  

  location
  context:Index.tml, line 9

* java.lang.IllegalArgumentException
  Parameter value was null or contained only whitespace.

  Hide uninteresting stack frames Stack trace
  o 
org.apache.tapestry5.ioc.internal.util.Defense.notBlank(Defense.java:59)

  o 
org.apache.tapestry5.internal.services.LinkImpl.addParameter(LinkImpl.java:55)

  o 
org.apache.tapestry5.internal.services.ComponentEventLinkEncoderImpl.createComponentEventLink(ComponentEventLinkEncoderImpl.java:212)

  o 
$ComponentEventLinkEncoder_124571f880c.createComponentEventLink($ComponentEventLinkEncoder_124571f880c.java)

  o 
org.apache.tapestry5.internal.services.LinkSourceImpl.createComponentEventLink(LinkSourceImpl.java:79)

  o 
$LinkSource_124571f881c.createComponentEventLink($LinkSource_124571f881c.java)

  o 
org.apache.tapestry5.internal.structure.ComponentPageElementResourcesImpl.createComponentEventLink(ComponentPageElementResourcesImpl.java:94)

  o 
org.apache.tapestry5.internal.structure.ComponentPageElementImpl.createEventLink(ComponentPageElementImpl.java:1204)

  o 
org.apache.tapestry5.internal.structure.InternalComponentResourcesImpl.createEventLink(InternalComponentResourcesImpl.java:173)

  o 
org.apache.tapestry5.corelib.components.ActionLink.createLink(ActionLink.java:36)

  o 
org.apache.tapestry5.corelib.base.AbstractComponentEventLink.beginRender(AbstractComponentEventLink.java:57)

  o 
org.apache.tapestry5.corelib.base.AbstractComponentEventLink.beginRender(AbstractComponentEventLink.java)

  o 
org.apache.tapestry5.internal.structure.ComponentPageElementImpl$BeginRenderPhase.invokeComponent(ComponentPageElementImpl.java:206)

  o 
org.apache.tapestry5.internal.structure.ComponentPageElementImpl$AbstractPhase.run(ComponentPageElementImpl.java:164)

  o 
org.apache.tapestry5.internal.structure.ComponentPageElementImpl.invoke(ComponentPageElementImpl.java:933)

  o 
org.apache.tapestry5.internal.structure.ComponentPageElementImpl.access$400(ComponentPageElementImpl.java:49)

  o 
org.apache.tapestry5.internal.structure.ComponentPageElementImpl$AbstractPhase.callback(ComponentPageElementImpl.java:159)

  o 
org.apache.tapestry5.internal.structure.ComponentPageElementImpl$BeginRenderPhase.render(ComponentPageElementImpl.java:211)

  o 
org.apache.tapestry5.internal.services.RenderQueueImpl.run(RenderQueueImpl.java:74)

  o 
org.apache.tapestry5.internal.services.PageRenderQueueImpl.render(PageRenderQueueImpl.java:121)

  o 
$PageRenderQueue_124571f887b.render($PageRenderQueue_124571f887b.java)

  o 
$PageR

RE: T5: t:delegate and component recursion emulation

2009-10-15 Thread Alfie Kirkpatrick
I can't comment in detail on your solution but it looks a bit convoluted
in the TML for my liking. A tree should be a first class component and
in this case I am prepared to do a little more work in the component
class to make it simple and intuitive to use. I wrote an ajax tree a
while back but just put together a non-ajax tree which might give you
some ideas... hope it helps!

The Tree component requires a very simple implementation of TreeModel,
in a similar vein to SelectModel, etc in the tapestry core. This means
that the application can determine where the model actually lives, and
optimise accordingly.

The body of the component defines precisely how each node is rendered.

Most of the complexity is in managing the push/pop between begin render
and after render. Hopefully this is not too confusing, and I actually
think it's pretty succinct given what it's doing.

I just knocked this together and haven't tested it extensively but can't
see why it would exhibit the kind of problems you are seeing with your
solution.

Best regards, Alfie.

-- Sample page TML usage -


${level}: ${item.title}, ${item.other}


-- Sample page class -
public class Tree {
@Property
private int level;

@Property
private TreeNode item;

private TreeNode rootNode;
public Tree() {
rootNode=new TreeNode("root", "1")
.add(new TreeNode("child", "1.1"))
.add(new TreeNode("child", "1.2")
.add(new TreeNode("child", "1.2.1"))
.add(new TreeNode("child", "1.2.2"))
)
.add(new TreeNode("child", "1.3")
.add(new TreeNode("child", "1.3.1"))
.add(new TreeNode("child", "1.3.2"))
)
.add(new TreeNode("child", "1.4"));
}

public TreeModel getModel() {
return new TreeModel() {
public Collection getChildren(TreeNode
node) {
return node.getChildren();
}

public TreeNode getRootNode() {
return rootNode;
}};
}

public class TreeNode {
private String title;
private String other;
private Collection children=new
ArrayList();

public TreeNode(String title, String other) {
this.title=title;
this.other=other;
}

public TreeNode add(TreeNode n) {
children.add(n);
return this;
}
public Collection getChildren() {
return
Collections.unmodifiableCollection(children);
}
public String getTitle() {
return title;
}
public String getOther() {
return other;
}
}
}

-- Tree.java 
public class Tree {
@Parameter(required=true)
private TreeModel model;

@Parameter
private int level;

@Parameter
private Object item;

private Stack> iteratorStack;

@SetupRender
public boolean setup() {
iteratorStack=new Stack>();

Object o=model.getRootNode();
if ( o == null ) {
// nothing in the model
return false;
}

item=o;
return true;
}

@BeginRender
public void begin(MarkupWriter writer) {
writer.element("div", "style", "margin-left:30px");
}

@AfterRender
public boolean after(MarkupWriter writer) {
Collection children = model.getChildren(item);
if ( children.size() == 0 ) {
// no children of this node
item=moveNext(writer);
return item == null;
} else {
level++;
iteratorStack.push(children.iterator());
item=iteratorStack.peek().next();
return false;
}
}

private Object moveNext(MarkupWriter writer) {
writer.end();

if ( iteratorStack.size() > 0 ) {
Iterator i = iteratorStack.peek();
if ( i.hasNext() ) {
return i.next();
   

Re: Parameter value was null or contained only whitespace

2009-10-15 Thread Borut Bolčina
Here it is (also in attachment, if it gets through)

An unexpected application exception has occurred.

   - org.apache.tapestry5.internal.services.RenderQueueExceptionRender queue
   error in BeginRender[Index:logout]: Parameter value was null or contained
   only whitespace.
   activeComponents
  - Verify (class si.najdi.rp.pages.Verify)
  - Index (class si.najdi.rp.pages.Index)
  - Index:layout (class si.najdi.rp.components.Layout)
  context:Index.tml, line 11http://tapestry.apache.org/schema/tapestry_5_1_0.xsd"4xmlns:p="tapestry:parameter";>
  5
  6 ${message:greeting}
  - Index:if (class org.apache.tapestry5.corelib.components.If)
  context:Index.tml, line 83 xmlns:t="
  
http://tapestry.apache.org/schema/tapestry_5_1_0.xsd"4xmlns:p="tapestry:parameter";>
  5
  6 ${message:greeting}7
  8 9 Welcome, ${user.firstName} | logout10 11 12 13 :
  - Index:logout (class
  org.apache.tapestry5.corelib.components.ActionLink)
  context:Index.tml, line 94 xmlns:p="tapestry:parameter">5
  6 ${message:greeting}7
  8 9 Welcome, ${user.firstName} | logout10 11 12 13 :14 
   locationcontext:Index.tml, line 9
   - java.lang.IllegalArgumentExceptionParameter value was null or contained
   only whitespace.
   Hide uninteresting stack frames Stack trace
  - org.apache.tapestry5.ioc.internal.util.Defense.notBlank(Defense.java:59)

  - 
org.apache.tapestry5.internal.services.LinkImpl.addParameter(LinkImpl.java:55)

  - 
org.apache.tapestry5.internal.services.ComponentEventLinkEncoderImpl.createComponentEventLink(ComponentEventLinkEncoderImpl.java:212)

  - 
$ComponentEventLinkEncoder_124571f880c.createComponentEventLink($ComponentEventLinkEncoder_124571f880c.java)

  - 
org.apache.tapestry5.internal.services.LinkSourceImpl.createComponentEventLink(LinkSourceImpl.java:79)

  - 
$LinkSource_124571f881c.createComponentEventLink($LinkSource_124571f881c.java)

  - 
org.apache.tapestry5.internal.structure.ComponentPageElementResourcesImpl.createComponentEventLink(ComponentPageElementResourcesImpl.java:94)

  - 
org.apache.tapestry5.internal.structure.ComponentPageElementImpl.createEventLink(ComponentPageElementImpl.java:1204)

  - 
org.apache.tapestry5.internal.structure.InternalComponentResourcesImpl.createEventLink(InternalComponentResourcesImpl.java:173)

  - 
org.apache.tapestry5.corelib.components.ActionLink.createLink(ActionLink.java:36)

  - 
org.apache.tapestry5.corelib.base.AbstractComponentEventLink.beginRender(AbstractComponentEventLink.java:57)

  - 
org.apache.tapestry5.corelib.base.AbstractComponentEventLink.beginRender(AbstractComponentEventLink.java)

  - 
org.apache.tapestry5.internal.structure.ComponentPageElementImpl$BeginRenderPhase.invokeComponent(ComponentPageElementImpl.java:206)

  - 
org.apache.tapestry5.internal.structure.ComponentPageElementImpl$AbstractPhase.run(ComponentPageElementImpl.java:164)

  - 
org.apache.tapestry5.internal.structure.ComponentPageElementImpl.invoke(ComponentPageElementImpl.java:933)

  - 
org.apache.tapestry5.internal.structure.ComponentPageElementImpl.access$400(ComponentPageElementImpl.java:49)

  - 
org.apache.tapestry5.internal.structure.ComponentPageElementImpl$AbstractPhase.callback(ComponentPageElementImpl.java:159)

  - 
org.apache.tapestry5.internal.structure.ComponentPageElementImpl$BeginRenderPhase.render(ComponentPageElementImpl.java:211)

  - 
org.apache.tapestry5.internal.services.RenderQueueImpl.run(RenderQueueImpl.java:74)

  - 
org.apache.tapestry5.internal.services.PageRenderQueueImpl.render(PageRenderQueueImpl.java:121)

  - $PageRenderQueue_124571f887b.render($PageRenderQueue_124571f887b.java)

  - $PageRenderQueue_124571f8872.render($PageRenderQueue_124571f8872.java)

  - 
org.apache.tapestry5.internal.services.MarkupRendererTerminator.renderMarkup(MarkupRendererTerminator.java:37)

  - 
org.apache.tapestry5.services.TapestryModule$27.renderMarkup(TapestryModule.java:1748)

  - 
$MarkupRenderer_124571f887d.renderMarkup($MarkupRenderer_124571f887d.java)

  - 
org.apache.tapestry5.services.TapestryModule$26.renderMarkup(TapestryModule.java:1732)

  - 
$MarkupRenderer_124571f887d.renderMarkup($MarkupRenderer_124571f887d.java)

  - 
org.apache.tapestry5.services.TapestryModule$25.renderMarkup(TapestryModule.java:1714)

  - 
$MarkupRenderer_124571f887d.renderMarkup($MarkupRenderer_124571f887d.java)

  - 
org.apache.tapestry5.services.TapestryModule$24.renderMarkup(TapestryModule.java:1700)

  - 
$MarkupRenderer_124571f887d.renderMarkup($MarkupRenderer_124571f887d.java)

  - 
org.apache.tapestry5.services.TapestryModule$23.renderMarkup(TapestryModule.java:1681)

  - 
$MarkupRenderer_124571f887d.renderMarkup($MarkupRenderer_124571f887d.java)

  - 
org.apache.tapestry5.services.TapestryModule$22.renderMarkup(TapestryModule.java:1662)

  - 
$MarkupRenderer_124571

Re: "component must be enclosed by a Form component" error

2009-10-15 Thread cordenier christophe
Hello
I think this is caused by 'inPlace=true'.

Regards.

2009/10/15 Lindsay Ridgeway 

>
> I have the following t:grid defined in the file "AccountLog.tml":
>
>
>. . .
>t:source="logs" t:row="log" t:reorder="createdOn, message"
>t:include="createdOn, message, messageType, recordState,
> stateDescription, updatedOn, actionCheckbox">
>${createdOn}
> name="stateDescriptionCell">${stateDescription}
>${updatedOn}
>Action
>
>  
>
>
>
>  
>
>
>. . .
>
>
> As you can see, the grid is seven columns.  The first six come from the
> objects in property "logs".  The seventh is an optional checkbox whose
> presence is controlled by a Boolean value in the log objects.
>
> As far as I can tell, everything about this page is now working except for
> one thing: If any of the checkboxes is visible on the page and you click
> one
> of the column headers, you get the following message with a red border
> across the top of the page:
>
> Ajax failure: Status 500 for
> /tux/admin/management/accountlog.grid.columns:sort/message/grid: Render
> queue error in SetupRender[admin/management/AccountLog:checkbox]: The
> Checkbox component must be enclosed by a Form component.
>
> This file has only one checkbox and only one form.  Of course, the first
> thing I looked for was to see whether the checkbox is between the "t:form"
> tag and its end-tag.  It is.  Maybe I don't understand the term "enclosed
> by".
>
> If no checkboxes are present, the error does not occur and you can sort by
> clicking a column header.
>
> Any help in getting rid of this error condition will be appreciated.
>
> --Lindsay
>
>
> --
> View this message in context:
> http://www.nabble.com/%22component-must-be-enclosed-by-a-Form-component%22-error-tp25902660p25902660.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: Parameter value was null or contained only whitespace

2009-10-15 Thread Ulrich Stärk
On first look I can't see what's wrong here. Could you please post exactly where this happens (the 
error report should give you the name of the component that is in error and a line number inside 
your template).


Uli

Am 15.10.2009 09:49 schrieb Borut Bolčina:

Hello,

I am having difficulties understand why the followinf piece of code gives me
the error "Parameter value was null or contained only whitespace". If I
remove  from the  or replace it with for example
, then the error does not appear. If I move 
outside  it works also, but I need to have  in 
obviously.

Please advise.

Index.tml
===
http://tapestry.apache.org/schema/tapestry_5_1_0.xsd";
  xmlns:p="tapestry:parameter">

${message:greeting}


Welcome, ${user.firstName} | logout



:



   



${message}




Index.java
=
public class Index {

@Inject
private Logger logger;

@Inject
private Request request;

@Property
@Persist(PersistenceConstants.FLASH)
private String openid;

@Inject
private Consumer consumer;

@SessionState
private Visit visit;

@SessionState(create = false)
@Property
private User user;
private boolean userExists;

private String message;

@Log
void onValidateFromOpenid(String openidurl) throws ValidationException {
try {
URL url = new URL(openidurl);
} catch (MalformedURLException e) {
throw new ValidationException("Nepravilen URL!");
}
}

@Log
URL onSuccess() throws DiscoveryException, MessageException,
ConsumerException, MalformedURLException  {
ConsumerManager manager = consumer.getManager();

// perform discovery on the user-supplied identifier
List discoveries = manager.discover(openid);

// attempt to associate with the OpenID provider
// and retrieve one service endpoint for authentication
DiscoveryInformation discovered = manager.associate(discoveries);

// store the discovery information in the user's session for later
use
// leave out for stateless operation / if there is no session
visit.setDiscoveryInformation(discovered);

// obtain a AuthRequest message to be sent to the OpenID provider
AuthRequest authReq = manager.authenticate(discovered, "
http://localhost:8080/rp/verify";);

// Redirect the User to Their OpenID Provider
return new URL(authReq.getDestinationUrl(true));
}

public void setMessage(String message) {
this.message = message;
}

public String getMessage() {
return this.message;
}

@Log
void onActionFromLogout() {
Session s = request.getSession(false);
if (s != null) {
s.invalidate();
}
}

}


I get to this page from Verify page which is called by some openid server (
myopenid.com for example)

Verify.java
==
public class Verify {

@Inject
private Logger logger;

@Inject
private Consumer consumer;

@Inject
private RequestGlobals requestGlobals;

@SessionState
private Visit visit;

@SessionState(create = false)
private User user;
private boolean userExists;

@InjectPage
private Index indexPage;

@Log
Object setupRender() throws MessageException, DiscoveryException,
AssociationException {
// extract the parameters from the authentication response
// (which comes in as a HTTP request from the OpenID provider)
HttpServletRequest httpServletRequest =
requestGlobals.getHTTPServletRequest();
ParameterList openidResp = new
ParameterList(httpServletRequest.getParameterMap());

// retrieve the previously stored discovery information
DiscoveryInformation discovered = visit.getDiscoveryInformation();

// extract the receiving URL from the HTTP request
StringBuffer receivingURL = httpServletRequest.getRequestURL();
String queryString = httpServletRequest.getQueryString();
if (queryString != null && queryString.length() > 0) {

receivingURL.append("?").append(httpServletRequest.getQueryString());
}

// verify the response
ConsumerManager manager = consumer.getManager();
VerificationResult verification =
manager.verify(receivingURL.toString(), openidResp, discovered);

// examine the verification result and extract the verified
identifier
Identifier verified = verification.getVerifiedId();

if (verified != null) {
// success, use the verified identifier to identify the user
logger.info("Success");
user = new User();
user.setFirstName((String)
verification.getAuthResponse().getParameterMap(

Parameter value was null or contained only whitespace

2009-10-15 Thread Borut Bolčina
Hello,

I am having difficulties understand why the followinf piece of code gives me
the error "Parameter value was null or contained only whitespace". If I
remove  from the  or replace it with for example
, then the error does not appear. If I move 
outside  it works also, but I need to have  in 
obviously.

Please advise.

Index.tml
===
http://tapestry.apache.org/schema/tapestry_5_1_0.xsd";
  xmlns:p="tapestry:parameter">

${message:greeting}


Welcome, ${user.firstName} | logout



:



   



${message}




Index.java
=
public class Index {

@Inject
private Logger logger;

@Inject
private Request request;

@Property
@Persist(PersistenceConstants.FLASH)
private String openid;

@Inject
private Consumer consumer;

@SessionState
private Visit visit;

@SessionState(create = false)
@Property
private User user;
private boolean userExists;

private String message;

@Log
void onValidateFromOpenid(String openidurl) throws ValidationException {
try {
URL url = new URL(openidurl);
} catch (MalformedURLException e) {
throw new ValidationException("Nepravilen URL!");
}
}

@Log
URL onSuccess() throws DiscoveryException, MessageException,
ConsumerException, MalformedURLException  {
ConsumerManager manager = consumer.getManager();

// perform discovery on the user-supplied identifier
List discoveries = manager.discover(openid);

// attempt to associate with the OpenID provider
// and retrieve one service endpoint for authentication
DiscoveryInformation discovered = manager.associate(discoveries);

// store the discovery information in the user's session for later
use
// leave out for stateless operation / if there is no session
visit.setDiscoveryInformation(discovered);

// obtain a AuthRequest message to be sent to the OpenID provider
AuthRequest authReq = manager.authenticate(discovered, "
http://localhost:8080/rp/verify";);

// Redirect the User to Their OpenID Provider
return new URL(authReq.getDestinationUrl(true));
}

public void setMessage(String message) {
this.message = message;
}

public String getMessage() {
return this.message;
}

@Log
void onActionFromLogout() {
Session s = request.getSession(false);
if (s != null) {
s.invalidate();
}
}

}


I get to this page from Verify page which is called by some openid server (
myopenid.com for example)

Verify.java
==
public class Verify {

@Inject
private Logger logger;

@Inject
private Consumer consumer;

@Inject
private RequestGlobals requestGlobals;

@SessionState
private Visit visit;

@SessionState(create = false)
private User user;
private boolean userExists;

@InjectPage
private Index indexPage;

@Log
Object setupRender() throws MessageException, DiscoveryException,
AssociationException {
// extract the parameters from the authentication response
// (which comes in as a HTTP request from the OpenID provider)
HttpServletRequest httpServletRequest =
requestGlobals.getHTTPServletRequest();
ParameterList openidResp = new
ParameterList(httpServletRequest.getParameterMap());

// retrieve the previously stored discovery information
DiscoveryInformation discovered = visit.getDiscoveryInformation();

// extract the receiving URL from the HTTP request
StringBuffer receivingURL = httpServletRequest.getRequestURL();
String queryString = httpServletRequest.getQueryString();
if (queryString != null && queryString.length() > 0) {

receivingURL.append("?").append(httpServletRequest.getQueryString());
}

// verify the response
ConsumerManager manager = consumer.getManager();
VerificationResult verification =
manager.verify(receivingURL.toString(), openidResp, discovered);

// examine the verification result and extract the verified
identifier
Identifier verified = verification.getVerifiedId();

if (verified != null) {
// success, use the verified identifier to identify the user
logger.info("Success");
user = new User();
user.setFirstName((String)
verification.getAuthResponse().getParameterMap().get("openid.identity"));
indexPage.setMessage("Success");

} else {
// OpenID authentication failed
logger.info("OpenID authentication failed");
indexPage.setMessage("Failed");
}
return index

Link to previous page in ExceptionReport

2009-10-15 Thread Stephan Windmüller
Hello!

We are using a customized ExceptionReport page to display an error
message to the user. From there we want provide a link to the previous
page so the user can retry the step.

My question is: How do I figure out from where the user came and perhaps
which data was in the activation context?

TIA
 Stephan Windmüller

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