|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.wiki.url.DefaultURLConstructor
public class DefaultURLConstructor

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.
| Field Summary | |
|---|---|
protected WikiEngine |
m_engine
|
protected String |
m_pathPrefix
Contains the absolute path of the JSPWiki Web application without the actual servlet (which is the m_urlPrefix). |
| Constructor Summary | |
|---|---|
DefaultURLConstructor()
|
|
| Method Summary | |
|---|---|
protected String |
doReplacement(String baseptrn,
String name,
boolean absolute)
Does replacement of some particular variables. |
String |
getForwardPage(javax.servlet.http.HttpServletRequest request)
This method is not needed for the DefaultURLConstructor. |
static String |
getURLPattern(String context,
String name)
Returns the URL pattern for a supplied wiki request context. |
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,
String encoding)
Should parse the "page" parameter from the actual request. |
static String |
parsePageFromURL(javax.servlet.http.HttpServletRequest request,
String encoding)
Takes the name of the page from the request URI. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected WikiEngine m_engine
protected String m_pathPrefix
| Constructor Detail |
|---|
public DefaultURLConstructor()
| Method Detail |
|---|
public void initialize(WikiEngine engine,
Properties properties)
initialize in interface URLConstructorengine - The WikiEngine that this URLConstructor belongs toproperties - Properties used to initialize
protected final String doReplacement(String baseptrn,
String name,
boolean absolute)
baseptrn - The pattern to usename - The page nameabsolute - If true, %u is always the entire base URL, otherwise it depends on
the setting in jspwiki.properties.
public static String getURLPattern(String context,
String name)
throws IllegalArgumentException
context - the wiki contextname - the wiki page
IllegalArgumentException - if the context cannot be found
public String makeURL(String context,
String name,
boolean absolute,
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.absolute - True, if you need an absolute URL. False, if both relative and absolute
URLs are fine.
public String parsePage(String context,
javax.servlet.http.HttpServletRequest request,
String encoding)
throws UnsupportedEncodingException
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).
UnsupportedEncodingException
public static String parsePageFromURL(javax.servlet.http.HttpServletRequest request,
String encoding)
throws UnsupportedEncodingException
request - The request to parseencoding - The encoding to use
UnsupportedEncodingException - If the encoding is not recognized.public String getForwardPage(javax.servlet.http.HttpServletRequest request)
getForwardPage in interface URLConstructorrequest - The HTTP Request that was used to end up in this page.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||