On Tue, 28 Oct 2014 15:11:13 -0200, George Christman <gchrist...@cardaddy.com> wrote:

Hi Thiago,

Hi!

I'm assuming you mean something like this, but I'm not seeing
the 301 response. Could you take a look and see if you can spot what I'm
doing wrong. Below is the response as well. Thank you.

Are you sure your code was actually called?



public class AccessController implements Dispatcher {

@Override
    public boolean dispatch(Request request, final Response response)
throws IOException {
        int port = request.getLocalPort();

        PageRenderRequestParameters parameters =
linkEncoder.decodePageRenderRequest(request);

        if (port == 80) {
            Link link =
linkSource.createPageRenderLinkWithContext(parameters.getLogicalPageName(),
parameters.getActivationContext());
            response.setStatus(HttpServletResponse.SC_MOVED_PERMANENTLY);
            link.setSecurity(LinkSecurity.SECURE);
            response.sendRedirect(link.toAbsoluteURI());
            return true;
        }

        componentRequestHandler.handlePageRender(parameters);
        return true;

You should return false when a Dispatcher didn't provide a response, so the last line should return false, otherwise no page will ever be rendered. I'm not sure why you've added the componentRequestHandler line.

--
Thiago H. de Paula Figueiredo
Tapestry, Java and Hibernate consultant and developer
http://machina.com.br

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

Reply via email to