Package org.ametys.cms
Class URIPrefixHandler
- java.lang.Object
-
- org.ametys.cms.URIPrefixHandler
-
- All Implemented Interfaces:
Component,Contextualizable
public class URIPrefixHandler extends Object implements Contextualizable, Component
Component providing base paths for computing URIs.
-
-
Constructor Summary
Constructors Constructor Description URIPrefixHandler()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcontextualize(Context context)StringgetAbsoluteUriPrefix()Get the absolutized version of the context path.StringgetUriPrefix()Get the application context path.
-
-
-
Field Detail
-
PATH_PREFIX
public static final String PATH_PREFIX
The request attribute name holding the current URL prefix- See Also:
- Constant Field Values
-
-
Constructor Detail
-
URIPrefixHandler
public URIPrefixHandler()
-
-
Method Detail
-
contextualize
public void contextualize(Context context) throws ContextException
- Specified by:
contextualizein interfaceContextualizable- Throws:
ContextException
-
getUriPrefix
public String getUriPrefix()
Get the application context path. Can be empty if the application resides in the root context. Use it to create a link beginning with the application root.- Returns:
- The application context path.
- See Also:
Request.getContextPath()
-
getAbsoluteUriPrefix
public String getAbsoluteUriPrefix()
Get the absolutized version of the context path. Use it to create an absolute link beginning with the application root, for instance when sending a mail linking to the application.- Returns:
- The absolute context path.
-
-