You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Richard Hill <ri...@su3analytics.com> on 2010/01/17 18:41:08 UTC

Different ExceptionReport for different pages

Hi All,

I have an ExceptionReport.java, .tml to present a pretty error page to
users. However there is one page where I would like to have a different
exception page. Is this possible? What's the simplest way of achieving
this?

Thanks very much,

Richard.


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


Re: Different ExceptionReport for different pages

Posted by cordenier christophe <ch...@gmail.com>.
Hi,

We have implemented such a feature in our project and documented it on our
blog
http://spreadthesource.com/2010/01/handle-multiple-exception-page-with-tapestry-5/

Hope this can help.

Christophe Cordenier,
Developper of Wooki

@http://wookicentral.com
Source code : http://github.com/robink/wooki


2010/1/17 Richard Hill <ri...@su3analytics.com>

> Hi Benny,
>
> That sounds promising. I'll try it out, thanks.
>
>
> -----Original Message-----
> From: Benny Law <be...@gmail.com>
> Reply-to: "Tapestry users" <us...@tapestry.apache.org>
> To: Tapestry users <us...@tapestry.apache.org>
> Subject: Re: Different ExceptionReport for different pages
> Date: Sun, 17 Jan 2010 16:06:07 -0500
>
> I haven't tried it myself, but the Tapestry documentation says that you can
> create an event handler in your special page to catch exceptions and
> redirect to a different exception page:
>
>    Object onException( Throwable cause ) {
>        return MySpecialExceptionReport.class;
>    }
>
> Don't know if this would help you in your case.
>
> Regards,
>
> Benny
>
> On Sun, Jan 17, 2010 at 2:54 PM, Howard Lewis Ship <hl...@gmail.com>
> wrote:
>
> > This is easier in 5.2 as there's a new RequestGlobals property that
> > identifies the name of the page for the request.
> >
> > On Sun, Jan 17, 2010 at 11:03 AM, Richard Hill <ri...@su3analytics.com>
> > wrote:
> > >
> > > Ok thanks. Is it possible to detect which page threw the exception? My
> > > logic needs to be based on the page that threw the exception as opposed
> > > to the type of exception.
> > >
> > >
> > >
> > >
> > >
> > > -----Original Message-----
> > > From: Thiago H. de Paula Figueiredo <th...@gmail.com>
> > > Reply-to: "Tapestry users" <us...@tapestry.apache.org>
> > > To: Tapestry users <us...@tapestry.apache.org>
> > > Subject: Re: Different ExceptionReport for different pages
> > > Date: Sun, 17 Jan 2010 16:25:09 -0200
> > >
> > > On Sun, 17 Jan 2010 15:41:08 -0200, Richard Hill <
> rich@su3analytics.com>
> > > wrote:
> > >
> > >> Hi All,
> > >
> > > Hi!
> > >
> > >> I have an ExceptionReport.java, .tml to present a pretty error page to
> > >> users. However there is one page where I would like to have a
> different
> > >> exception page. Is this possible?
> > >
> > > Simple answer: you can, but I think it's not worth the hassle. Just use
> > > some logic in your error page to show different content to different
> > > exceptions. You can also redirect to another page in your
> ExceptionReport
> > > page.
> > >
> > > Sophisticated answer: override the RequestExceptionHandler service.
> Draw
> > > some inspiration from RequestExceptionHandlerImpl.
> > >
> > >
> > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> > > For additional commands, e-mail: users-help@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-unsubscribe@tapestry.apache.org
> > For additional commands, e-mail: users-help@tapestry.apache.org
> >
> >
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>

Re: Different ExceptionReport for different pages

Posted by Richard Hill <ri...@su3analytics.com>.
Hi Benny,

That sounds promising. I'll try it out, thanks.


-----Original Message-----
From: Benny Law <be...@gmail.com>
Reply-to: "Tapestry users" <us...@tapestry.apache.org>
To: Tapestry users <us...@tapestry.apache.org>
Subject: Re: Different ExceptionReport for different pages
Date: Sun, 17 Jan 2010 16:06:07 -0500

I haven't tried it myself, but the Tapestry documentation says that you can
create an event handler in your special page to catch exceptions and
redirect to a different exception page:

    Object onException( Throwable cause ) {
        return MySpecialExceptionReport.class;
    }

Don't know if this would help you in your case.

Regards,

Benny

On Sun, Jan 17, 2010 at 2:54 PM, Howard Lewis Ship <hl...@gmail.com> wrote:

> This is easier in 5.2 as there's a new RequestGlobals property that
> identifies the name of the page for the request.
>
> On Sun, Jan 17, 2010 at 11:03 AM, Richard Hill <ri...@su3analytics.com>
> wrote:
> >
> > Ok thanks. Is it possible to detect which page threw the exception? My
> > logic needs to be based on the page that threw the exception as opposed
> > to the type of exception.
> >
> >
> >
> >
> >
> > -----Original Message-----
> > From: Thiago H. de Paula Figueiredo <th...@gmail.com>
> > Reply-to: "Tapestry users" <us...@tapestry.apache.org>
> > To: Tapestry users <us...@tapestry.apache.org>
> > Subject: Re: Different ExceptionReport for different pages
> > Date: Sun, 17 Jan 2010 16:25:09 -0200
> >
> > On Sun, 17 Jan 2010 15:41:08 -0200, Richard Hill <ri...@su3analytics.com>
> > wrote:
> >
> >> Hi All,
> >
> > Hi!
> >
> >> I have an ExceptionReport.java, .tml to present a pretty error page to
> >> users. However there is one page where I would like to have a different
> >> exception page. Is this possible?
> >
> > Simple answer: you can, but I think it's not worth the hassle. Just use
> > some logic in your error page to show different content to different
> > exceptions. You can also redirect to another page in your ExceptionReport
> > page.
> >
> > Sophisticated answer: override the RequestExceptionHandler service. Draw
> > some inspiration from RequestExceptionHandlerImpl.
> >
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> > For additional commands, e-mail: users-help@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-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>



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


Re: Different ExceptionReport for different pages

Posted by Benny Law <be...@gmail.com>.
I haven't tried it myself, but the Tapestry documentation says that you can
create an event handler in your special page to catch exceptions and
redirect to a different exception page:

    Object onException( Throwable cause ) {
        return MySpecialExceptionReport.class;
    }

Don't know if this would help you in your case.

Regards,

Benny

On Sun, Jan 17, 2010 at 2:54 PM, Howard Lewis Ship <hl...@gmail.com> wrote:

> This is easier in 5.2 as there's a new RequestGlobals property that
> identifies the name of the page for the request.
>
> On Sun, Jan 17, 2010 at 11:03 AM, Richard Hill <ri...@su3analytics.com>
> wrote:
> >
> > Ok thanks. Is it possible to detect which page threw the exception? My
> > logic needs to be based on the page that threw the exception as opposed
> > to the type of exception.
> >
> >
> >
> >
> >
> > -----Original Message-----
> > From: Thiago H. de Paula Figueiredo <th...@gmail.com>
> > Reply-to: "Tapestry users" <us...@tapestry.apache.org>
> > To: Tapestry users <us...@tapestry.apache.org>
> > Subject: Re: Different ExceptionReport for different pages
> > Date: Sun, 17 Jan 2010 16:25:09 -0200
> >
> > On Sun, 17 Jan 2010 15:41:08 -0200, Richard Hill <ri...@su3analytics.com>
> > wrote:
> >
> >> Hi All,
> >
> > Hi!
> >
> >> I have an ExceptionReport.java, .tml to present a pretty error page to
> >> users. However there is one page where I would like to have a different
> >> exception page. Is this possible?
> >
> > Simple answer: you can, but I think it's not worth the hassle. Just use
> > some logic in your error page to show different content to different
> > exceptions. You can also redirect to another page in your ExceptionReport
> > page.
> >
> > Sophisticated answer: override the RequestExceptionHandler service. Draw
> > some inspiration from RequestExceptionHandlerImpl.
> >
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> > For additional commands, e-mail: users-help@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-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>

Re: Different ExceptionReport for different pages

Posted by Peter Stavrinides <P....@albourne.com>.
> This is easier in 5.2 as there's a new RequestGlobals property that
> identifies the name of the page for the request.
Wow thats a useful feature, nice!



----- Original Message -----
From: "Howard Lewis Ship" <hl...@gmail.com>
To: "Tapestry users" <us...@tapestry.apache.org>, rich@su3analytics.com
Sent: Sunday, 17 January, 2010 21:54:19 GMT +02:00 Athens, Beirut, Bucharest, Istanbul
Subject: Re: Different ExceptionReport for different pages

This is easier in 5.2 as there's a new RequestGlobals property that
identifies the name of the page for the request.

On Sun, Jan 17, 2010 at 11:03 AM, Richard Hill <ri...@su3analytics.com> wrote:
>
> Ok thanks. Is it possible to detect which page threw the exception? My
> logic needs to be based on the page that threw the exception as opposed
> to the type of exception.
>
>
>
>
>
> -----Original Message-----
> From: Thiago H. de Paula Figueiredo <th...@gmail.com>
> Reply-to: "Tapestry users" <us...@tapestry.apache.org>
> To: Tapestry users <us...@tapestry.apache.org>
> Subject: Re: Different ExceptionReport for different pages
> Date: Sun, 17 Jan 2010 16:25:09 -0200
>
> On Sun, 17 Jan 2010 15:41:08 -0200, Richard Hill <ri...@su3analytics.com>
> wrote:
>
>> Hi All,
>
> Hi!
>
>> I have an ExceptionReport.java, .tml to present a pretty error page to
>> users. However there is one page where I would like to have a different
>> exception page. Is this possible?
>
> Simple answer: you can, but I think it's not worth the hassle. Just use
> some logic in your error page to show different content to different
> exceptions. You can also redirect to another page in your ExceptionReport
> page.
>
> Sophisticated answer: override the RequestExceptionHandler service. Draw
> some inspiration from RequestExceptionHandlerImpl.
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@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-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


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


Re: Different ExceptionReport for different pages

Posted by Howard Lewis Ship <hl...@gmail.com>.
This is easier in 5.2 as there's a new RequestGlobals property that
identifies the name of the page for the request.

On Sun, Jan 17, 2010 at 11:03 AM, Richard Hill <ri...@su3analytics.com> wrote:
>
> Ok thanks. Is it possible to detect which page threw the exception? My
> logic needs to be based on the page that threw the exception as opposed
> to the type of exception.
>
>
>
>
>
> -----Original Message-----
> From: Thiago H. de Paula Figueiredo <th...@gmail.com>
> Reply-to: "Tapestry users" <us...@tapestry.apache.org>
> To: Tapestry users <us...@tapestry.apache.org>
> Subject: Re: Different ExceptionReport for different pages
> Date: Sun, 17 Jan 2010 16:25:09 -0200
>
> On Sun, 17 Jan 2010 15:41:08 -0200, Richard Hill <ri...@su3analytics.com>
> wrote:
>
>> Hi All,
>
> Hi!
>
>> I have an ExceptionReport.java, .tml to present a pretty error page to
>> users. However there is one page where I would like to have a different
>> exception page. Is this possible?
>
> Simple answer: you can, but I think it's not worth the hassle. Just use
> some logic in your error page to show different content to different
> exceptions. You can also redirect to another page in your ExceptionReport
> page.
>
> Sophisticated answer: override the RequestExceptionHandler service. Draw
> some inspiration from RequestExceptionHandlerImpl.
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@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-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: Different ExceptionReport for different pages

Posted by Richard Hill <ri...@su3analytics.com>.
Ok thanks. Is it possible to detect which page threw the exception? My
logic needs to be based on the page that threw the exception as opposed
to the type of exception.





-----Original Message-----
From: Thiago H. de Paula Figueiredo <th...@gmail.com>
Reply-to: "Tapestry users" <us...@tapestry.apache.org>
To: Tapestry users <us...@tapestry.apache.org>
Subject: Re: Different ExceptionReport for different pages
Date: Sun, 17 Jan 2010 16:25:09 -0200

On Sun, 17 Jan 2010 15:41:08 -0200, Richard Hill <ri...@su3analytics.com>  
wrote:

> Hi All,

Hi!

> I have an ExceptionReport.java, .tml to present a pretty error page to
> users. However there is one page where I would like to have a different
> exception page. Is this possible?

Simple answer: you can, but I think it's not worth the hassle. Just use  
some logic in your error page to show different content to different  
exceptions. You can also redirect to another page in your ExceptionReport  
page.

Sophisticated answer: override the RequestExceptionHandler service. Draw  
some inspiration from RequestExceptionHandlerImpl.




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


RE: Passing Activation parameters to a page

Posted by ai...@bt.com.
Excellent.. Thanks Thiago. Ill give that a go.

-----Original Message-----
From: Thiago H. de Paula Figueiredo [mailto:thiagohp@gmail.com] 
Sent: 18 January 2010 15:03
To: Tapestry users
Subject: Re: Passing Activation parameters to a page

On Mon, 18 Jan 2010 12:18:10 -0200, <ai...@bt.com> wrote:

> I have a large collection of lots of different Objects of varying 
> classes (all stemming from the one superclass) and have a view/edit 
> page for each of them.  Instead of a big switch I simply wanted to 
> redirect to page "viewthe"+selectedType and then pass the ID;

Use the ComponentSource service and its getPage(String name) method.

--
Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer, and instructor Owner, software architect and developer, Ars Machina Tecnologia da Informação Ltda.
http://www.arsmachina.com.br

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


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


Re: Passing Activation parameters to a page

Posted by "Thiago H. de Paula Figueiredo" <th...@gmail.com>.
On Mon, 18 Jan 2010 12:18:10 -0200, <ai...@bt.com> wrote:

> I have a large collection of lots of different Objects of varying  
> classes (all stemming from the one superclass) and have a view/edit page  
> for each of them.  Instead of a big switch I simply wanted to redirect  
> to page "viewthe"+selectedType and then pass the ID;

Use the ComponentSource service and its getPage(String name) method.

-- 
Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,  
and instructor
Owner, software architect and developer, Ars Machina Tecnologia da  
Informação Ltda.
http://www.arsmachina.com.br

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


RE: Passing Activation parameters to a page

Posted by ai...@bt.com.
Thx for the reply. I was kindof expecting that.
I have a large collection of lots of different Objects of varying classes (all stemming from the one superclass) and have a view/edit page for each of them.  Instead of a big switch I simply wanted to redirect to page "viewthe"+selectedType and then pass the ID;

I know its not ideal but it felt like a quick way of achieving what I required.

Any other recommendations?
On a page I have rows (one per object) that all stem from one superclass.  On selection of a particular row I want to redirect to the appropriate viewer page.  There will be at least 20 different subclasses (nesting no more than 2)

If required I can do a big switch but it rather find a smarter way to redirect to the right page and pass in the ID of the particular object.
A



-----Original Message-----
From: Thiago H. de Paula Figueiredo [mailto:thiagohp@gmail.com] 
Sent: 18 January 2010 13:07
To: Tapestry users
Subject: Re: Passing Activation parameters to a page

On Mon, 18 Jan 2010 11:00:12 -0200, <ai...@bt.com> wrote:

> Hi folks,

Hi!

> But I have a situation where I need to use the String method for page 
> navigation but still need to pass a parameter.

You can't return a String and still pass the activation context. Why do you need to return a String at first?

--
Thiago H. de Paula Figueiredo
Coordenador e professor da Especialização em Engenharia de Software com Ênfase em Java da Faculdade Pitágoras Consultor, desenvolvedor e instrutor em Java, Tapestry e Hibernate Sócio, 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-help@tapestry.apache.org


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


Re: Passing Activation parameters to a page

Posted by "Thiago H. de Paula Figueiredo" <th...@gmail.com>.
On Mon, 18 Jan 2010 11:00:12 -0200, <ai...@bt.com> wrote:

> Hi folks,

Hi!

> But I have a situation where I need to use the String method for page  
> navigation but still need to pass a parameter.

You can't return a String and still pass the activation context. Why do  
you need to return a String at first?

-- 
Thiago H. de Paula Figueiredo
Coordenador e professor da Especialização em Engenharia de Software com  
Ênfase em Java da Faculdade Pitágoras
Consultor, desenvolvedor e instrutor em Java, Tapestry e Hibernate
Sócio, 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-help@tapestry.apache.org


RE: Antwort: Passing Activation parameters to a page

Posted by ai...@bt.com.
Thanks Kris, you made me think - I don't need to use doSomething method at this point - so a pagelink was enough and I could control that from the tml. 

Yours and Thiago's suggestions were excellent - ill try both out and see which one I understand best ;)
A


-----Original Message-----
From: Kristian Marinkovic [mailto:kristian.marinkovic@porsche.co.at] 
Sent: 18 January 2010 13:12
To: Tapestry users
Subject: Antwort: Passing Activation parameters to a page

hi, 

you can't do it this way. if you return a string Tapestry will interpret it as a logical page name and return the rendered page as response (see PageNameComponentEventResultProcessor)

but you can create a Link with the desired paramters using the LinkSoruce.createPageRenderLink method and return it in your action method

g,
kris



<ai...@bt.com>
18.01.2010 14:00
Bitte antworten an
"Tapestry users" <us...@tapestry.apache.org>


An
<us...@tapestry.apache.org>
Kopie

Thema
Passing Activation parameters to a page







Hi folks,
Quick question - I am trying to pass parameters using the activation 
context.
I normally use:
InjectPage
PageX thePage
...
...
onSomeEvent() {
thePage.setSomeParameter("SS");
Return thePage;
}

But I have a situation where I need to use the String method for page 
navigation but still need to pass a parameter. 

onSomeEvent(){ 
return "PageX"; }

Any advice on how I pass activation parameters to PageX when using this 
method?
Cant find anything relevant on Nabble.  Hope you can help.
Aidan

-----Original Message-----
From: Thiago H. de Paula Figueiredo [mailto:thiagohp@gmail.com] 
Sent: 17 January 2010 18:25
To: Tapestry users
Subject: Re: Different ExceptionReport for different pages

On Sun, 17 Jan 2010 15:41:08 -0200, Richard Hill <ri...@su3analytics.com>
wrote:

> Hi All,

Hi!

> I have an ExceptionReport.java, .tml to present a pretty error page to 
> users. However there is one page where I would like to have a 
> different exception page. Is this possible?

Simple answer: you can, but I think it's not worth the hassle. Just use 
some logic in your error page to show different content to different 
exceptions. You can also redirect to another page in your ExceptionReport 
page.

Sophisticated answer: override the RequestExceptionHandler service. Draw 
some inspiration from RequestExceptionHandlerImpl.

--
Thiago H. de Paula Figueiredo
Coordenador e professor da Especialização em Engenharia de Software com 
Ênfase em Java da Faculdade Pitágoras Consultor, desenvolvedor e instrutor 
em Java, Tapestry e Hibernate Sócio, 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-help@tapestry.apache.org


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



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


Antwort: Passing Activation parameters to a page

Posted by Kristian Marinkovic <kr...@porsche.co.at>.
hi, 

you can't do it this way. if you return a string Tapestry will interpret 
it as a logical page name and return the rendered page as 
response (see PageNameComponentEventResultProcessor)

but you can create a Link with the desired paramters using the
LinkSoruce.createPageRenderLink method and return it in your
action method

g,
kris



<ai...@bt.com> 
18.01.2010 14:00
Bitte antworten an
"Tapestry users" <us...@tapestry.apache.org>


An
<us...@tapestry.apache.org>
Kopie

Thema
Passing Activation parameters to a page







Hi folks,
Quick question - I am trying to pass parameters using the activation 
context.
I normally use:
InjectPage
PageX thePage
...
...
onSomeEvent() {
thePage.setSomeParameter("SS");
Return thePage;
}

But I have a situation where I need to use the String method for page 
navigation but still need to pass a parameter. 

onSomeEvent(){ 
return "PageX"; }

Any advice on how I pass activation parameters to PageX when using this 
method?
Cant find anything relevant on Nabble.  Hope you can help.
Aidan

-----Original Message-----
From: Thiago H. de Paula Figueiredo [mailto:thiagohp@gmail.com] 
Sent: 17 January 2010 18:25
To: Tapestry users
Subject: Re: Different ExceptionReport for different pages

On Sun, 17 Jan 2010 15:41:08 -0200, Richard Hill <ri...@su3analytics.com>
wrote:

> Hi All,

Hi!

> I have an ExceptionReport.java, .tml to present a pretty error page to 
> users. However there is one page where I would like to have a 
> different exception page. Is this possible?

Simple answer: you can, but I think it's not worth the hassle. Just use 
some logic in your error page to show different content to different 
exceptions. You can also redirect to another page in your ExceptionReport 
page.

Sophisticated answer: override the RequestExceptionHandler service. Draw 
some inspiration from RequestExceptionHandlerImpl.

--
Thiago H. de Paula Figueiredo
Coordenador e professor da Especialização em Engenharia de Software com 
Ênfase em Java da Faculdade Pitágoras Consultor, desenvolvedor e instrutor 
em Java, Tapestry e Hibernate Sócio, 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-help@tapestry.apache.org


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



Passing Activation parameters to a page

Posted by ai...@bt.com.
Hi folks,
Quick question - I am trying to pass parameters using the activation context.
I normally use:
InjectPage
PageX thePage
...
...
onSomeEvent() {
thePage.setSomeParameter("SS");
Return thePage;
}

But I have a situation where I need to use the String method for page navigation but still need to pass a parameter.  

onSomeEvent(){ 
return "PageX"; }

Any advice on how I pass activation parameters to PageX when using this method?
Cant find anything relevant on Nabble.  Hope you can help.
Aidan

-----Original Message-----
From: Thiago H. de Paula Figueiredo [mailto:thiagohp@gmail.com] 
Sent: 17 January 2010 18:25
To: Tapestry users
Subject: Re: Different ExceptionReport for different pages

On Sun, 17 Jan 2010 15:41:08 -0200, Richard Hill <ri...@su3analytics.com>
wrote:

> Hi All,

Hi!

> I have an ExceptionReport.java, .tml to present a pretty error page to 
> users. However there is one page where I would like to have a 
> different exception page. Is this possible?

Simple answer: you can, but I think it's not worth the hassle. Just use some logic in your error page to show different content to different exceptions. You can also redirect to another page in your ExceptionReport page.

Sophisticated answer: override the RequestExceptionHandler service. Draw some inspiration from RequestExceptionHandlerImpl.

--
Thiago H. de Paula Figueiredo
Coordenador e professor da Especialização em Engenharia de Software com Ênfase em Java da Faculdade Pitágoras Consultor, desenvolvedor e instrutor em Java, Tapestry e Hibernate Sócio, 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-help@tapestry.apache.org


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


Re: Different ExceptionReport for different pages

Posted by "Thiago H. de Paula Figueiredo" <th...@gmail.com>.
On Sun, 17 Jan 2010 15:41:08 -0200, Richard Hill <ri...@su3analytics.com>  
wrote:

> Hi All,

Hi!

> I have an ExceptionReport.java, .tml to present a pretty error page to
> users. However there is one page where I would like to have a different
> exception page. Is this possible?

Simple answer: you can, but I think it's not worth the hassle. Just use  
some logic in your error page to show different content to different  
exceptions. You can also redirect to another page in your ExceptionReport  
page.

Sophisticated answer: override the RequestExceptionHandler service. Draw  
some inspiration from RequestExceptionHandlerImpl.

-- 
Thiago H. de Paula Figueiredo
Coordenador e professor da Especialização em Engenharia de Software com  
Ênfase em Java da Faculdade Pitágoras
Consultor, desenvolvedor e instrutor em Java, Tapestry e Hibernate
Sócio, 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-help@tapestry.apache.org