public class TemplatePathResolver
extends java.lang.Object
Resolve template path for ActContext
Constructor and Description |
---|
TemplatePathResolver() |
Modifier and Type | Method and Description |
---|---|
protected java.lang.String |
amendSuffix(java.lang.String path,
ActContext context) |
static boolean |
isAcceptFormatSupported(org.osgl.http.H.Format fmt) |
static void |
registerSupportedFormats(java.util.Collection<org.osgl.http.H.Format> fmts) |
static void |
registerSupportedFormats(org.osgl.http.H.Format... fmts) |
java.lang.String |
resolve(ActContext context) |
protected java.lang.String |
resolveTemplatePath(java.lang.String path,
ActContext context)
Sub class shall use this method to implement template path resolving logic.
|
java.lang.String |
resolveWithContextMethodPath(ActContext context) |
public final java.lang.String resolve(ActContext context)
public final java.lang.String resolveWithContextMethodPath(ActContext context)
protected java.lang.String resolveTemplatePath(java.lang.String path, ActContext context)
Sub class shall use this method to implement template path resolving logic.
The default implementation will append the template file suffix based on the accepted format
. E.g. if accepted format is text/html
, then it will append .html
to the path specified if suffix is not presented in the path
path
- the template path stringcontext
- the act contextprotected java.lang.String amendSuffix(java.lang.String path, ActContext context)
public static void registerSupportedFormats(org.osgl.http.H.Format... fmts)
public static void registerSupportedFormats(java.util.Collection<org.osgl.http.H.Format> fmts)
public static boolean isAcceptFormatSupported(org.osgl.http.H.Format fmt)
Copyright © 2014–2017 ActFramework. All rights reserved.