| java.lang.Object com.ecyrd.jspwiki.url.DefaultURLConstructor
All known Subclasses: com.ecyrd.jspwiki.url.ShortURLConstructor,
DefaultURLConstructor | public class DefaultURLConstructor implements URLConstructor(Code) | | Implements the default URL constructor using links directly to the
JSP pages. This is what JSPWiki by default is using. For example,
WikiContext.VIEW points at "Wiki.jsp", etc.
author: Janne Jalkanen since: 2.2 |
Method Summary | |
final protected String | doReplacement(String baseptrn, String name, boolean absolute) Does replacement of some particular variables. | public String | getForwardPage(HttpServletRequest request) This method is not needed for the DefaultURLConstructor. | public static String | getURLPattern(String context, String name) Returns the URL pattern for a supplied wiki request context. | public void | initialize(WikiEngine engine, Properties properties) | public String | makeURL(String context, String name, boolean absolute, String parameters) Constructs the URL with a bunch of parameters. | public String | parsePage(String context, HttpServletRequest request, String encoding) Should parse the "page" parameter from the actual
request. | public static String | parsePageFromURL(HttpServletRequest request, String encoding) Takes the name of the page from the request URI.
The initial slash is also removed. |
m_pathPrefix | protected String m_pathPrefix(Code) | | Contains the absolute path of the JSPWiki Web application without the
actual servlet (which is the m_urlPrefix).
|
m_useRelativeURLStyle | protected boolean m_useRelativeURLStyle(Code) | | Are URL styles relative or absolute?
|
doReplacement | final protected String doReplacement(String baseptrn, String name, boolean absolute)(Code) | | Does replacement of some particular variables. The variables are:
- "%u" - inserts either the base URL (when absolute is required), or the base path
(which is an absolute path without the host name).
- "%U" - always inserts the base URL
- "%p" - always inserts the base path
- "%n" - inserts the page name
Parameters: baseptrn - The pattern to use Parameters: name - The page name Parameters: absolute - If true, %u is always the entire base URL, otherwise it depends onthe setting in jspwiki.properties. A replacement. |
makeURL | public String makeURL(String context, String name, boolean absolute, String parameters)(Code) | | Constructs the URL with a bunch of parameters.
Parameters: parameters - If null or empty, no parameters are added. |
parsePageFromURL | public static String parsePageFromURL(HttpServletRequest request, String encoding) throws UnsupportedEncodingException(Code) | | Takes the name of the page from the request URI.
The initial slash is also removed. If there is no page,
returns null.
Parameters: request - The request to parse Parameters: encoding - The encoding to use a parsed page name, or null, if it cannot be found throws: UnsupportedEncodingException - If the encoding is not recognized. |
|
|