private String getHttpMethod(RewriteSubstitutionContext context) { WebContext webContext = context.getParserWebContext(); String httpMethod = webContext.get(HTTP_METHOD_KEY); if (StringUtil.isBlank(httpMethod)) { httpMethod = webContext.getRequest().getMethod(); } return httpMethod; }
@SuppressWarnings("unchecked") public <T> T get(String name) { T value = super.get(name); if (value != null) { return value; } return (T) webContext.get(name); }
HttpServletRequest request = context.getRequest(); boolean isDebug = true; String isReleaseMode = context.get("TINY_IS_RELEASE_MODE"); if (isReleaseMode != null && isReleaseMode.length() > 0) { isDebug = Boolean.parseBoolean(isReleaseMode); String contextPath = context.get("TINY_CONTEXT_PATH"); try { String lastModifiedSign;
.getWriter() .write(jsonConverter.convert(context .get("modelProcessResult"))); } else {// 返回页面 if (customizeConfig != null
String[] parameterNames = discoverer.getParameterNames(method); for (int i = 0; i < paramTypes.length; i++) { args[i] = context.get(parameterNames[i]); Class type = paramTypes[i]; if (args[i] == null) {
public void preProcess(WebContext context) { String dataSourceName = context.get(DATASOURCE); if (dataSourceName != null && !"".equals(dataSourceName.trim())) { DataSourceInfo.setDataSource(dataSourceName); } }
private boolean isPageCached(WebContext wrapperContext) { PageCacheWebContext pageCacheWebContext = WebContextUtil .findWebContext(wrapperContext, PageCacheWebContext.class); String accessPath = wrapperContext.get(WebContextUtil.TINY_REQUEST_URI); if (pageCacheWebContext != null) { return pageCacheWebContext.isCached(accessPath); } return false; }
/** * 创建一个新的<code>RequestContext</code>对象。 * * @param webContext * 当前请求所在的<code>ServletContext</code> * @param request * <code>HttpServletRequest</code>对象 * @param response * <code>HttpServletResponse</code>对象 */ public SimpleWebContext(WebContext webContext, FilterHandler handler, HttpServletRequest request, HttpServletResponse response) { super(webContext, handler); Object object = webContext .get(WebContext.REQUEST_ATTRIBUTE_FROM_WEBCONTEXT); getAttributeFromWebContext = object != null && Boolean.FALSE .equals(Boolean.parseBoolean(object.toString())) ? false : true; setRequest(new RequestWrapper(request)); setResponse(new CommittingAwareResponse(response, this)); }
public void reallyProcess(String urlString, WebContext context) { logger.logMessage(LogLevel.INFO, "{}开始处理",urlString); String serviceId = getRequestId(urlString); FlowExecutor executor=SpringUtil.getBean(FlowExecutor.PAGE_FLOW_BEAN); String nodeId = context.get(NODE_ID); if(nodeId==null||"".equals(nodeId)){ executor.execute(serviceId, context); }else{ executor.execute(serviceId,nodeId, context); } logger.logMessage(LogLevel.INFO, "{}处理结束",urlString); }
method.getDeclaringClass(), method); for (int i = 0; i < paramTypes.length; i++) { args[i] = context.get(parameterNames[i]); Class type = paramTypes[i]; if (args[i] == null) {