com.ecyrd.jspwiki.url
Class ShortViewURLConstructor
java.lang.Object
com.ecyrd.jspwiki.url.DefaultURLConstructor
com.ecyrd.jspwiki.url.ShortURLConstructor
com.ecyrd.jspwiki.url.ShortViewURLConstructor
- All Implemented Interfaces:
- 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
- Author:
- jalkanen
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ShortViewURLConstructor
public ShortViewURLConstructor()
initialize
public void initialize(WikiEngine engine,
Properties properties)
- Description copied from interface:
URLConstructor
- Initializes. Note that the engine is not fully initialized
at this point, so don't do anything fancy here - use lazy
init, if you have to.
- Specified by:
initialize
in interface URLConstructor
- Overrides:
initialize
in class ShortURLConstructor
makeURL
public String makeURL(String context,
String name,
boolean absolute,
String parameters)
- Description copied from class:
ShortURLConstructor
- Constructs the URL with a bunch of parameters.
- Specified by:
makeURL
in interface URLConstructor
- Overrides:
makeURL
in class ShortURLConstructor
- 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.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.
- Returns:
- An URL pointing to the resource. Must never return null - throw an InternalWikiException
if something goes wrong.
getForwardPage
public String getForwardPage(javax.servlet.http.HttpServletRequest req)
- Since we're only called from WikiServlet, where we get the VIEW requests,
we can safely return this.
- Specified by:
getForwardPage
in interface URLConstructor
- Overrides:
getForwardPage
in class ShortURLConstructor
- Parameters:
req
- The HTTP Request that was used to end up in this page.
- Returns:
- "Wiki.jsp", "PageInfo.jsp", etc. Just return the name,
JSPWiki will figure out the page.