public abstract class AbstractHandler extends Object implements Handler
| 限定符和类型 | 字段和说明 |
|---|---|
static ConfigOption |
DEFAULT_RESOURCE_OPTION |
protected String |
handlerName |
static com.ds.common.logging.Log |
logger |
static ConfigOption |
RESOURCE_MOUNT_OPTION |
static ConfigOption |
RULE_OPTION |
protected Server |
server |
static ConfigOption |
URL_PREFIX_OPTION |
protected String |
urlPrefix |
CKEY, CUSSCLASSNAME, httpHeaderArr, pattArr, ProjectName, ProjectVersionName, RefererHeard, VVVERSION| 构造器和说明 |
|---|
AbstractHandler() |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
copyStreamToFile(InputStream input,
File file) |
void |
copyStreamToFile(String url,
File file) |
protected Map<String,String> |
createQueryMap(String query) |
String |
formatPath(String urlStr,
String projectName) |
Map<String,Object> |
getAllParamMap(com.ds.web.RequestMethodBean methodBean,
HttpRequest request) |
String |
getContentType(HttpRequest request) |
Map |
getContextMap() |
String |
getExtStr(String ftl) |
InputStream |
getInputStream(String content,
String charSet) |
protected String |
getMimeType(String filename) |
String |
getName() |
ognl.OgnlContext |
getOgnlContext() |
Map<String,Object> |
getPathParamsValue(String methodUrl,
String url) |
String |
getProjectName(HttpRequest request) |
com.ds.web.RequestMethodBean |
getRequestMethodBean(HttpRequest request) |
Server |
getServer() |
Object |
getService(com.ds.web.RequestMethodBean methodBean,
HttpRequest request) |
String |
getUrlPrefix() |
boolean |
handle(Request aRequest,
Response aResponse) |
protected boolean |
handleBody(HttpRequest request,
HttpResponse response) |
boolean |
initialize(String handlerName,
Server server) |
Object |
invokMethod(com.ds.web.RequestMethodBean methodBean) |
Object |
invokMethod(com.ds.web.RequestMethodBean methodBean,
HttpRequest request,
HttpResponse response) |
boolean |
isNullParams(String paramName) |
protected boolean |
isRequestdForHandler(HttpRequest request) |
boolean |
sendFtl(HttpRequest request,
HttpResponse response,
String resource) |
boolean |
sendJSON(com.ds.web.RequestMethodBean methodBean,
HttpResponse response,
String json) |
void |
setOgnlContext(ognl.OgnlContext ognlContext) |
void |
setServer(Server server) |
boolean |
shutdown(Server server) |
Object |
upload(com.ds.web.RequestMethodBean methodBean,
HttpRequest request,
HttpResponse response) |
public static final com.ds.common.logging.Log logger
protected Server server
protected String handlerName
protected String urlPrefix
public static final ConfigOption RESOURCE_MOUNT_OPTION
public static final ConfigOption DEFAULT_RESOURCE_OPTION
public static final ConfigOption RULE_OPTION
public static final ConfigOption URL_PREFIX_OPTION
public boolean initialize(String handlerName, Server server)
initialize 在接口中 Handlerpublic boolean handle(Request aRequest, Response aResponse) throws IOException
handle 在接口中 HandlerIOExceptionpublic Object invokMethod(com.ds.web.RequestMethodBean methodBean)
public Object invokMethod(com.ds.web.RequestMethodBean methodBean, HttpRequest request, HttpResponse response) throws ClassNotFoundException, ognl.OgnlException, IOException
ClassNotFoundExceptionognl.OgnlExceptionIOExceptionpublic boolean sendFtl(HttpRequest request, HttpResponse response, String resource) throws IOException
IOExceptionpublic boolean sendJSON(com.ds.web.RequestMethodBean methodBean,
HttpResponse response,
String json)
public Object upload(com.ds.web.RequestMethodBean methodBean, HttpRequest request, HttpResponse response) throws IOException
IOExceptionpublic String getProjectName(HttpRequest request) throws MalformedURLException
public boolean isNullParams(String paramName)
public String formatPath(String urlStr, String projectName) throws MalformedURLException
public InputStream getInputStream(String content, String charSet)
public String getExtStr(String ftl) throws IOException, freemarker.template.TemplateException
IOExceptionfreemarker.template.TemplateExceptionpublic String getContentType(HttpRequest request)
public ognl.OgnlContext getOgnlContext()
public Map<String,Object> getAllParamMap(com.ds.web.RequestMethodBean methodBean, HttpRequest request)
public Object getService(com.ds.web.RequestMethodBean methodBean, HttpRequest request) throws ClassNotFoundException, ognl.OgnlException
ClassNotFoundExceptionognl.OgnlExceptionprotected boolean isRequestdForHandler(HttpRequest request)
protected boolean handleBody(HttpRequest request, HttpResponse response) throws IOException
IOExceptionpublic String getUrlPrefix()
public Server getServer()
public void setServer(Server server)
public Map getContextMap()
public void copyStreamToFile(InputStream input, File file) throws IOException
IOExceptionpublic void copyStreamToFile(String url, File file) throws IOException
IOExceptionpublic com.ds.web.RequestMethodBean getRequestMethodBean(HttpRequest request) throws MalformedURLException
public void setOgnlContext(ognl.OgnlContext ognlContext)
Copyright © 2025 onecode. All rights reserved.