You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Stephan Windmüller <st...@cs.tu-dortmund.de> on 2009/10/22 11:47:42 UTC
Which service returns the eventContext?
Hello!
I am trying to put the eventContext of a page which causes an exception
into the ExceptionReport class. From there I want to return to the page
which caused the error.
Currently I am stuck with creating a RequestExceptionHandler because I
cannot find a service which gives me the eventContext of the last page.
The Request object still contains the URL with the needed path. How do I
get the eventContext from here?
TIA
Stephan
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: Which service returns the eventContext?
Posted by Stephan Windmüller <st...@cs.tu-dortmund.de>.
Thiago H. de Paula Figueiredo wrote:
>> What do you mean with "content"? How do I access this?
> I was saying that, in a POST form submit, the field values aren't stored
> in the URL, they are stored as the content of the HTTP request. You can
> get any value by injecting Request and invoking its getParameterNames() to
> get a List<String> of parameter (field) names and getParameter(String
> name) or getParameters(String name) to get their value.
That worked, thank you!
Regards
Stephan
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: Which service returns the eventContext?
Posted by "Thiago H. de Paula Figueiredo" <th...@gmail.com>.
Em Fri, 23 Oct 2009 05:13:04 -0200, Stephan Windmüller
<st...@cs.tu-dortmund.de> escreveu:
> Thiago H. de Paula Figueiredo wrote:
>
>>> Hm, this does not work with forms. Is the POST data not part of the
>>> Request?
>> It is the content of the request, as HTML is the content of a page
>> render
>> request.
>
> What do you mean with "content"? How do I access this?
I was saying that, in a POST form submit, the field values aren't stored
in the URL, they are stored as the content of the HTTP request. You can
get any value by injecting Request and invoking its getParameterNames() to
get a List<String> of parameter (field) names and getParameter(String
name) or getParameters(String name) to get their value.
> Was ComponentEventLinkEncoder the wrong choice for my needs?
It is the right choice to get the page and event context.
--
Thiago H. de Paula Figueiredo
Independent Java consultant, developer, and instructor
http://www.arsmachina.com.br/thiago
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: Which service returns the eventContext?
Posted by Stephan Windmüller <st...@cs.tu-dortmund.de>.
Thiago H. de Paula Figueiredo wrote:
>> Hm, this does not work with forms. Is the POST data not part of the
>> Request?
> It is the content of the request, as HTML is the content of a page render
> request.
What do you mean with "content"? How do I access this?
Was ComponentEventLinkEncoder the wrong choice for my needs?
Regards
Stephan
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: Which service returns the eventContext?
Posted by "Thiago H. de Paula Figueiredo" <th...@gmail.com>.
Em Thu, 22 Oct 2009 12:02:25 -0200, Stephan Windmüller
<st...@cs.tu-dortmund.de> escreveu:
> Hm, this does not work with forms. Is the POST data not part of the
> Request?
It is the content of the request, as HTML is the content of a page render
request.
--
Thiago H. de Paula Figueiredo
Independent Java consultant, developer, and instructor
http://www.arsmachina.com.br/thiago
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: Re: Which service returns the eventContext?
Posted by ig...@gmail.com.
The implementation of ComponentEventLinkEncoder is only examining the
requested path.
http://tapestry.apache.org/tapestry5.1/apidocs/org/apache/tapestry5/services/Request.html#getPath%28%29
Since event context and page activation context are encoded into the patn
it works fine. Form inputs are never incoded into the path.
Is it your question?
On Oct 22, 2009 4:02pm, Stephan Windmüller
<st...@cs.tu-dortmund.de> wrote:
> Stephan Windmüller wrote:
> >> The Request object still contains the URL with the needed path. How do
> I
> >> get the eventContext from here?
> > The solution for this was the service "ComponentEventLinkEncoder". It
> > creates a PageRenderRequestParameters object which contains the
> > EventContext. Thanks to Igor Drobiazko for pointing this out!
> Hm, this does not work with forms. Is the POST data not part of the
> Request?
> - Stephan
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
Re: Which service returns the eventContext?
Posted by Stephan Windmüller <st...@cs.tu-dortmund.de>.
Stephan Windmüller wrote:
>> The Request object still contains the URL with the needed path. How do I
>> get the eventContext from here?
> The solution for this was the service "ComponentEventLinkEncoder". It
> creates a PageRenderRequestParameters object which contains the
> EventContext. Thanks to Igor Drobiazko for pointing this out!
Hm, this does not work with forms. Is the POST data not part of the Request?
- Stephan
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: Which service returns the eventContext?
Posted by Stephan Windmüller <st...@cs.tu-dortmund.de>.
Stephan Windmüller wrote:
> The Request object still contains the URL with the needed path. How do I
> get the eventContext from here?
The solution for this was the service "ComponentEventLinkEncoder". It
creates a PageRenderRequestParameters object which contains the
EventContext. Thanks to Igor Drobiazko for pointing this out!
Additionally I needed a new interface for the ExceptionReport page to
allow a class cast despite of the different class loaders[0]
- Stephan
[0] http://tapestry.apache.org/tapestry5/guide/reload.html
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org