You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by "Darren Williams (JIRA)" <ta...@jakarta.apache.org> on 2005/10/02 20:52:48 UTC

[jira] Commented: (TAPESTRY-682) Exposing serviceName in RequestCycle

    [ http://issues.apache.org/jira/browse/TAPESTRY-682?page=comments#action_12331095 ] 

Darren Williams commented on TAPESTRY-682:
------------------------------------------

However when getService() is used within an exception it will not work. Scenario is as follows. We are mapping the old Tapestry 3 calls such as: app?service=page/Index

The we pass an override into our custom exception handler, since this is not a valid service under Tapestry 4. If we call cycle.getService().getName() then we get another exception as it attempts to resolve the service again subsequently generating an endless loop.

Our current workaround is to parse the cycle.toString() as follows:

String raw = cycle.toString();
int index1 = raw.indexOf("serviceName=page/");

While this works OK and we can redirect from here it seems like a bit of a hack just to retrive a value that we already know exists, but cannot be accessed.

> Exposing serviceName in RequestCycle
> ------------------------------------
>
>          Key: TAPESTRY-682
>          URL: http://issues.apache.org/jira/browse/TAPESTRY-682
>      Project: Tapestry
>         Type: Improvement
>   Components: Framework
>     Versions: 4.0
>     Reporter: Darren Williams
>     Assignee: Howard M. Lewis Ship
>     Priority: Minor

>
> There is currently no way of extracting the serviceName (_serviceName) from the Request Cycle except by converting the request into a string and then parsing the result. This is often needed when generating custom exceptions and trying to trap the serviceName to provide additional functionality, redirects etc.
> Can we expose thise parameter through a public getter method to make life easier for those that wish to use this parameter.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


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