|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT |
@Retention(value=RUNTIME) @Target(value=TYPE) public @interface VirtualURIMapper
Used on a type to have all its methods that can be used as 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
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT |