Package org.apache.wiki.url
Class ShortViewURLConstructor
- java.lang.Object
-
- org.apache.wiki.url.DefaultURLConstructor
-
- org.apache.wiki.url.ShortURLConstructor
-
- org.apache.wiki.url.ShortViewURLConstructor
-
- All Implemented Interfaces:
Initializable,URLConstructor
public class ShortViewURLConstructor extends ShortURLConstructor
A specific URL constructor that returns easy-to-grok URLs for VIEW and ATTACH contexts, but goes through JSP pages otherwise.- Since:
- 2.2
-
-
Field Summary
-
Fields inherited from class org.apache.wiki.url.ShortURLConstructor
m_urlPrefix, PROP_PREFIX
-
Fields inherited from class org.apache.wiki.url.DefaultURLConstructor
m_engine, m_pathPrefix
-
-
Constructor Summary
Constructors Constructor Description ShortViewURLConstructor()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetForwardPage(javax.servlet.http.HttpServletRequest request)Since we're only called from WikiServlet, where we get the VIEW requests, we can safely return this.voidinitialize(Engine engine, java.util.Properties properties)java.lang.StringmakeURL(java.lang.String context, java.lang.String name, java.lang.String parameters)Constructs the URL with a bunch of parameters.-
Methods inherited from class org.apache.wiki.url.ShortURLConstructor
parsePage
-
Methods inherited from class org.apache.wiki.url.DefaultURLConstructor
doReplacement, getURLPattern
-
-
-
-
Constructor Detail
-
ShortViewURLConstructor
public ShortViewURLConstructor()
-
-
Method Detail
-
initialize
public void initialize(Engine engine, java.util.Properties properties)
- Specified by:
initializein interfaceInitializable- Overrides:
initializein classShortURLConstructor
-
makeURL
public java.lang.String makeURL(java.lang.String context, java.lang.String name, java.lang.String parameters)
Constructs the URL with a bunch of parameters.- Specified by:
makeURLin interfaceURLConstructor- Overrides:
makeURLin classShortURLConstructor- Parameters:
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.parameters- If null or empty, no parameters are added. If null or empty, no parameters are added. An URL parameter string (these must be URL-encoded, and separated with &)- Returns:
- An URL pointing to the resource. Must never return null - throw an InternalWikiException if something goes wrong.
-
getForwardPage
public java.lang.String getForwardPage(javax.servlet.http.HttpServletRequest request)
Since we're only called from WikiServlet, where we get the VIEW requests, we can safely return this.- Specified by:
getForwardPagein interfaceURLConstructor- Overrides:
getForwardPagein classShortURLConstructor- Parameters:
request- The HTTP Request that was used to end up in this page.- Returns:
- always returns "Wiki.jsp"
-
-