public class DefaultURLConstructor extends java.lang.Object implements URLConstructor
| Modifier and Type | Field and Description |
|---|---|
protected Engine |
m_engine |
protected java.lang.String |
m_pathPrefix
Contains the absolute path of the JSPWiki Web application without the actual servlet (which is the m_urlPrefix).
|
| Constructor and Description |
|---|
DefaultURLConstructor() |
| Modifier and Type | Method and Description |
|---|---|
protected java.lang.String |
doReplacement(java.lang.String baseptrn,
java.lang.String name)
Does replacement of some particular variables.
|
java.lang.String |
getForwardPage(javax.servlet.http.HttpServletRequest request)
This method is not needed for the DefaultURLConstructor.
|
static java.lang.String |
getURLPattern(java.lang.String context,
java.lang.String name)
Returns the URL pattern for a supplied wiki request context.
|
void |
initialize(Engine engine,
java.util.Properties properties) |
java.lang.String |
makeURL(java.lang.String context,
java.lang.String name,
java.lang.String parameters)
Constructs the URL with a bunch of parameters.
|
java.lang.String |
parsePage(java.lang.String context,
javax.servlet.http.HttpServletRequest request,
java.nio.charset.Charset encoding)
Should parse the "page" parameter from the actual request.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitparsePageFromURLprotected java.lang.String m_pathPrefix
public DefaultURLConstructor()
public void initialize(Engine engine, java.util.Properties properties)
initialize in interface Initializableprotected final java.lang.String doReplacement(java.lang.String baseptrn, java.lang.String name)
baseptrn - The pattern to usename - The page namepublic static java.lang.String getURLPattern(java.lang.String context, java.lang.String name) throws java.lang.IllegalArgumentException
context - the wiki contextname - the wiki pagejava.lang.IllegalArgumentException - if the context cannot be foundpublic java.lang.String makeURL(java.lang.String context, java.lang.String name, java.lang.String parameters)
makeURL in interface URLConstructorparameters - If null or empty, no parameters are added.
An URL parameter string (these must be URL-encoded, and separated with &)context - The request context (@see WikiContext) that you want the URL forname - The page name (or in case of WikiContext.NONE, the auxiliary JSP page
or resource you want to point at). This must be URL encoded. Null is NOT safe.public java.lang.String parsePage(java.lang.String context, javax.servlet.http.HttpServletRequest request, java.nio.charset.Charset encoding)
parsePage in interface URLConstructorcontext - In which request context the request was made (this should help in parsing)request - The HTTP request that was used when coming hereencoding - The encoding with which the request was made (UTF-8 or ISO-8859-1).public java.lang.String getForwardPage(javax.servlet.http.HttpServletRequest request)
getForwardPage in interface URLConstructorrequest - The HTTP Request that was used to end up in this page.Copyright (c) 2001-2022 The Apache Software Foundation. All rights reserved.