You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by "Howard M. Lewis Ship (JIRA)" <de...@tapestry.apache.org> on 2008/01/06 22:59:34 UTC
[jira] Assigned: (TAPESTRY-1823) It is not possible to create a
reasonable implementation of RequestExceptionHandler without importing
internal interfaces and services
[ https://issues.apache.org/jira/browse/TAPESTRY-1823?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Howard M. Lewis Ship reassigned TAPESTRY-1823:
----------------------------------------------
Assignee: Howard M. Lewis Ship
> It is not possible to create a reasonable implementation of RequestExceptionHandler without importing internal interfaces and services
> --------------------------------------------------------------------------------------------------------------------------------------
>
> Key: TAPESTRY-1823
> URL: https://issues.apache.org/jira/browse/TAPESTRY-1823
> Project: Tapestry
> Issue Type: Bug
> Components: tapestry-core
> Affects Versions: 5.0.5
> Reporter: Howard M. Lewis Ship
> Assignee: Howard M. Lewis Ship
> Priority: Critical
>
> It's not just a case of making the necessary interfaces public, but of providing public wrappers that ... for instance ... reference a page by name rather than as a Page instance (an internal type that should stay that way).
> here's an example:
> import java.io.IOException;
> import org.apache.commons.logging.Log;
> import org.apache.tapestry.Link;
> import org.apache.tapestry.internal.services.LinkFactory;
> import org.apache.tapestry.services.RequestExceptionHandler;
> import org.apache.tapestry.services.Response;
> public class ProductionRequestExceptionHandler implements RequestExceptionHandler {
> private final Log _log;
> private final LinkFactory _linkFactory;
> private final Response _response;
> public ProductionRequestExceptionHandler(Log log, LinkFactory linkFactory, Response response) {
> _log = log;
> _linkFactory = linkFactory;
> _response = response;
> }
> public void handleRequestException(Throwable exception) throws IOException {
> _log.error("An exception has occurred: " + exception.getMessage(), exception);
> Link link = _linkFactory.createPageLink("AppError", false);
> _response.sendRedirect(link.toRedirectURI());
> }
> }
> LinkFactory is internal. Even if it was promoted up, it includes Page which is internal.
> Suggestion: create a public service, PageLinkFactory with method:
> Link createPageLink(String pageName, boolean override, Object... activationContext)
> that's a tiny, thin wrapper around the internal LinkFactory.
> Something similar, for using a page to generate a direct response (rather than a redirect) might be nice, but is less urgent (exception generally occur during action requests, for which we should send a redirect).
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
For additional commands, e-mail: dev-help@tapestry.apache.org