public class ShortURLConstructor extends DefaultURLConstructor
Modifier and Type | Field and Description |
---|---|
protected String |
m_urlPrefix
Contains the path part after the JSPWiki base URL
|
static String |
PROP_PREFIX
This corresponds to your WikiServlet path.
|
m_engine, m_pathPrefix
Constructor and Description |
---|
ShortURLConstructor() |
Modifier and Type | Method and Description |
---|---|
String |
getForwardPage(javax.servlet.http.HttpServletRequest req)
This method is not needed for the DefaultURLConstructor.
|
void |
initialize(WikiEngine engine,
Properties properties)
Initializes.
|
String |
makeURL(String context,
String name,
boolean absolute,
String parameters)
Constructs the URL with a bunch of parameters.
|
String |
parsePage(String context,
javax.servlet.http.HttpServletRequest request,
Charset encoding)
Should parse the "page" parameter from the actual
request.
|
doReplacement, getURLPattern, parsePageFromURL
protected String m_urlPrefix
public static final String PROP_PREFIX
public ShortURLConstructor()
public void initialize(WikiEngine engine, Properties properties)
initialize
in interface URLConstructor
initialize
in class DefaultURLConstructor
engine
- The WikiEngine that this URLConstructor belongs toproperties
- Properties used to initializepublic String makeURL(String context, String name, boolean absolute, String parameters)
makeURL
in interface URLConstructor
makeURL
in class DefaultURLConstructor
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.absolute
- True, if you need an absolute URL. False, if both relative and absolute URLs are fine.parameters
- If null or empty, no parameters are added.
An URL parameter string (these must be URL-encoded, and separated with &)public String parsePage(String context, javax.servlet.http.HttpServletRequest request, Charset encoding)
parsePage
in interface URLConstructor
parsePage
in class DefaultURLConstructor
context
- 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 String getForwardPage(javax.servlet.http.HttpServletRequest req)
getForwardPage
in interface URLConstructor
getForwardPage
in class DefaultURLConstructor
req
- The HTTP Request that was used to end up in this page.Copyright © 2001-2019 The Apache Software Foundation. All rights reserved.