@Retention(value=RUNTIME) @Target(value=TYPE) public @interface VirtualURIMapper
VirtualURIMapping
s
exposed to Magnolia. Methods can return String or MappingResult and accept as arguments the incoming uri as a String
and/or a HttpServletRequest. The returned URI can be prefixed with "redirect:", "permanent:" or "forward:" to trigger
either a temporary redirect, a permanent redirect or a forward respectively. For redirects the URI can be absolute or
relative within the web application (the context path is added automatically).
For example:
@VirtualURIMapper public class ExampleUriMapper { public String about(String uri, HttpServletRequest request) { if (uri.equals("/about.html")) return "/sections/about"; return null; } public String newsletter(String uri) { if (uri.equals("/newsletter.html")) return "redirect:/sections/newsletter.html"; return null; } }
VirtualURIMapping
Copyright © 2009–2015 Magnolia International Ltd.. All rights reserved.