Contains all of the informations concerning a given link. The content of the link is stored as if it were a text paragraph.
Standard properties include : none. @author Fromentin Xavier, Schnell Michaƫl, Dervin Cyrielle, Brabant Quentin @version 1.0
186187188189190191192193194195196
boolean handled = requestHandler.service(request, response); if (!handled) { throw new RuntimeException(String.format( "Request was not handled: '%s' may not be a valid page name.", pageName)); } Link link = response.getRedirectLink(); if (link != null) { setupRequestFromLink(link); continue;
267268269270271272273274275276277
if (!handled) throw new RuntimeException(String.format("Request for path '%s' was not handled by Tapestry.", request.getPath())); Link link = response.getRedirectLink(); if (link != null) { setupRequestFromLink(link); continue;
6364656667686970717273
// Page is secure but request is not, so redirect. // We can safely ignore the forForm parameter since secure form requests are alway done from // an already secured page Link link = componentEventLinkEncoder.createComponentEventLink(parameters, false); response.sendRedirect(link); return true; }
7879808182838485868788
if (!needsRedirect(parameters.getLogicalPageName())) return false; // Page is secure but request is not, so redirect. Link link = componentEventLinkEncoder.createPageRenderLink(parameters); response.sendRedirect(link); return true; }
3738394041424344454647
train_encodeRedirectURL(response, URI, ENCODED); replay(); Link link = new LinkImpl(URI, true, false, response, optimizer); assertEquals(link.toRedirectURI(), ENCODED); verify(); }
5556575859606162636465
train_optimizePath(optimizer, "/bar/" + RAW_PATH, OPTIMIZED); train_encodeURL(response, OPTIMIZED, ENCODED); replay(); Link link = new LinkImpl("/bar/" + RAW_PATH, true, false, response, optimizer); assertEquals(link.toString(), ENCODED); verify(); }
70717273747576777879808182
RequestPathOptimizer optimizer = mockRequestPathOptimizer(); Response response = mockResponse(); replay(); Link link = new LinkImpl("/foo/bar", true, false, response, optimizer); link.addParameter("fred", "flintstone"); assertEquals(link.getParameterValue("fred"), "flintstone"); verify(); }
90919293949596979899100101102103
train_optimizePath(optimizer, "/foo/bar", OPTIMIZED); train_encodeURL(response, OPTIMIZED, ENCODED); replay(); Link link = new LinkImpl("/foo/bar", true, false, response, optimizer); link.setAnchor("wilma"); assertSame(link.getAnchor(), "wilma"); assertEquals(link.toURI(), ENCODED + "#" + "wilma"); verify(); }
110111112113114115116117118119120
train_encodeURL(response, "/ctx/foo", ENCODED); replay(); Link link = new LinkImpl("/ctx/foo", true, false, response, optimizer); assertEquals(link.toAbsoluteURI(), ENCODED); verify(); }
128129130131132133134135136137138139
String expectedURI = "/ctx/foo?foo=bar&baz=barney"; train_encodeURL(response, expectedURI, expectedURI); replay(); Link link = new LinkImpl("/ctx/foo?foo=bar", false, false, response, optimizer); link.addParameter("baz", "barney"); assertEquals(link.toURI(), expectedURI); verify(); }