当前位置: 首页 > news >正文

局机关建设网站的意义怎么做企业网站平台

局机关建设网站的意义,怎么做企业网站平台,网站打不开dns修改,常州做的网站的公司网站说明 本文基于 jdk 8, spring-framework 5.2.x 编写。author JellyfishMIX - github / blog.jellyfishmix.comLICENSE GPL-2.0 类层次 HandlerMethod#xff0c;处理器的方法的封装对象。HandlerMethod 只提供了处理器的方法的基本信息#xff0c;不提供调用逻辑。 Invoca…说明 本文基于 jdk 8, spring-framework 5.2.x 编写。author JellyfishMIX - github / blog.jellyfishmix.comLICENSE GPL-2.0 类层次 HandlerMethod处理器的方法的封装对象。HandlerMethod 只提供了处理器的方法的基本信息不提供调用逻辑。 InvocableHandlerMethod继承 HandlerMethod 类可调用的 HandlerMethod 实现类。 ServletInvocableHandlerMethod#invokeAndHandle 方法 org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod#invokeAndHandle 核心方法处理请求。 执行调用处理请求设置 responseStatus。如果 returnValue 为空设置 ModelAndViewContainer 为请求已处理然后 return和 ResponseStatus 注解相关。设置 ModelAndViewContainer 为请求未处理通过 HandlerMethodReturnValueHandlerComposite(HandlerMethodReturnValueHandler) 处理返回值。 public class ServletInvocableHandlerMethod extends InvocableHandlerMethod {Nullableprivate HandlerMethodReturnValueHandlerComposite returnValueHandlers;public void invokeAndHandle(ServletWebRequest webRequest, ModelAndViewContainer mavContainer,Object... providedArgs) throws Exception {// 执行调用处理请求Object returnValue invokeForRequest(webRequest, mavContainer, providedArgs);// 设置 responseStatussetResponseStatus(webRequest);// 如果 returnValue 为空设置 ModelAndViewContainer 为请求已处理然后 return和 ResponseStatus 注解相关if (returnValue null) {if (isRequestNotModified(webRequest) || getResponseStatus() ! null || mavContainer.isRequestHandled()) {disableContentCachingIfNecessary(webRequest);mavContainer.setRequestHandled(true);return;}}else if (StringUtils.hasText(getResponseStatusReason())) {mavContainer.setRequestHandled(true);return;}// 设置 ModelAndViewContainer 为请求未处理mavContainer.setRequestHandled(false);Assert.state(this.returnValueHandlers ! null, No return value handlers);try {// 通过 HandlerMethodReturnValueHandlerComposite(HandlerMethodReturnValueHandler) 处理返回值this.returnValueHandlers.handleReturnValue(returnValue, getReturnValueType(returnValue), mavContainer, webRequest);}catch (Exception ex) {if (logger.isTraceEnabled()) {logger.trace(formatErrorForReturnValue(returnValue), ex);}throw ex;}} }ServletInvocableHandlerMethod#setResponseStatus 方法 org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod#setResponseStatus 调用 setResponseStatus(ServletWebRequest webRequest) 设置响应的状态码。 获得 status和 ResponseStatus 注解相关。设置响应的状态码。有 reason则设置 status reason。无 reason仅设置 status。RedirectView 相关。 private void setResponseStatus(ServletWebRequest webRequest) throws IOException {// 获得 status和 ResponseStatus 注解相关HttpStatus status getResponseStatus();if (status null) {return;}// 设置响应的状态码HttpServletResponse response webRequest.getResponse();if (response ! null) {String reason getResponseStatusReason();// 有 reason则设置 status reasonif (StringUtils.hasText(reason)) {response.sendError(status.value(), reason);}else {// 无 reason仅设置 statusresponse.setStatus(status.value());}}// To be picked up by RedirectView// RedirectView 相关webRequest.getRequest().setAttribute(View.RESPONSE_STATUS_ATTRIBUTE, status);}InvocableHandlerMethod InvocableHandlerMethod#invokeForRequest 方法 – 执行调用处理请求 org.springframework.web.method.support.InvocableHandlerMethod#invokeForRequest 执行调用处理请求。 Nullablepublic Object invokeForRequest(NativeWebRequest request, Nullable ModelAndViewContainer mavContainer,Object... providedArgs) throws Exception {// 解析参数Object[] args getMethodArgumentValues(request, mavContainer, providedArgs);if (logger.isTraceEnabled()) {logger.trace(Arguments: Arrays.toString(args));}// 执行调用return doInvoke(args);}InvocableHandlerMethod#getMethodArgumentValues 方法 – 解析参数 org.springframework.web.method.support.InvocableHandlerMethod#getMethodArgumentValues 获得方法的参数。遍历方法参数将参数解析成对应的类型。 获得当前遍历的 MethodParameter 对象给它设置 parameterNameDiscoverer。从 providedArgs 中获得参数。如果获得到则进入下一个参数的解析默认情况 providedArgs 不会传参。判断 resolvers 是否支持当前的参数解析。执行参数解析解析成功后进入下一个参数的解析。 protected Object[] getMethodArgumentValues(NativeWebRequest request, Nullable ModelAndViewContainer mavContainer, Object... providedArgs) throws Exception {// 获得方法的参数MethodParameter[] parameters getMethodParameters();// 无参返回空数组if (ObjectUtils.isEmpty(parameters)) {return EMPTY_ARGS;}// 遍历方法参数将参数解析成对应的类型Object[] args new Object[parameters.length];for (int i 0; i parameters.length; i) {// 获得当前遍历的 MethodParameter 对象给它设置 parameterNameDiscovererMethodParameter parameter parameters[i];parameter.initParameterNameDiscovery(this.parameterNameDiscoverer);// 从 providedArgs 中获得参数。如果获得到则进入下一个参数的解析默认情况 providedArgs 不会传参。args[i] findProvidedArgument(parameter, providedArgs);if (args[i] ! null) {continue;}// 判断 resolvers 是否支持当前的参数解析if (!this.resolvers.supportsParameter(parameter)) {throw new IllegalStateException(formatArgumentError(parameter, No suitable resolver));}try {// 执行参数解析解析成功后进入下一个参数的解析args[i] this.resolvers.resolveArgument(parameter, mavContainer, request, this.dataBinderFactory);}catch (Exception ex) {// Leave stack trace for later, exception may actually be resolved and handled...if (logger.isDebugEnabled()) {String exMsg ex.getMessage();if (exMsg ! null !exMsg.contains(parameter.getExecutable().toGenericString())) {logger.debug(formatArgumentError(parameter, exMsg));}}throw ex;}}return args;}InvocableHandlerMethod#doInvoke 方法 org.springframework.web.method.support.InvocableHandlerMethod#doInvoke 设置方法为可访问。通过反射执行方法调用。BridgedMethod 基于泛型安全为了和 jdk 1.5 之前的字节码兼容无需关注 BridgedMethod。 Nullableprotected Object doInvoke(Object... args) throws Exception {// 设置方法为可访问ReflectionUtils.makeAccessible(getBridgedMethod());try {// 通过反射执行方法调用。BridgedMethod 基于泛型安全为了和 jdk 1.5 之前的字节码兼容无需关注 BridgedMethodreturn getBridgedMethod().invoke(getBean(), args);}catch (IllegalArgumentException ex) {assertTargetBean(getBridgedMethod(), getBean(), args);String text (ex.getMessage() ! null ? ex.getMessage() : Illegal argument);throw new IllegalStateException(formatInvokeError(text, args), ex);}catch (InvocationTargetException ex) {// Unwrap for HandlerExceptionResolvers ...Throwable targetException ex.getTargetException();if (targetException instanceof RuntimeException) {throw (RuntimeException) targetException;}else if (targetException instanceof Error) {throw (Error) targetException;}else if (targetException instanceof Exception) {throw (Exception) targetException;}else {throw new IllegalStateException(formatInvokeError(Invocation failure, args), targetException);}}}后言 本文可以看到很重要的两个组件 HandlerMethodArgumentResolver 用于获取请求参数HandlerMethodReturnValueHandler 用于处理返回值后续分析。
文章转载自:
http://www.morning.znlhc.cn.gov.cn.znlhc.cn
http://www.morning.tntqr.cn.gov.cn.tntqr.cn
http://www.morning.dfhkh.cn.gov.cn.dfhkh.cn
http://www.morning.rdsst.cn.gov.cn.rdsst.cn
http://www.morning.bpmtl.cn.gov.cn.bpmtl.cn
http://www.morning.nbdtdjk.cn.gov.cn.nbdtdjk.cn
http://www.morning.rfrnc.cn.gov.cn.rfrnc.cn
http://www.morning.wbqk.cn.gov.cn.wbqk.cn
http://www.morning.brzlp.cn.gov.cn.brzlp.cn
http://www.morning.tnthd.cn.gov.cn.tnthd.cn
http://www.morning.lkwyr.cn.gov.cn.lkwyr.cn
http://www.morning.bnxnq.cn.gov.cn.bnxnq.cn
http://www.morning.dfdhx.cn.gov.cn.dfdhx.cn
http://www.morning.qtkfp.cn.gov.cn.qtkfp.cn
http://www.morning.ryrpq.cn.gov.cn.ryrpq.cn
http://www.morning.kpbq.cn.gov.cn.kpbq.cn
http://www.morning.wpqwk.cn.gov.cn.wpqwk.cn
http://www.morning.jcxqc.cn.gov.cn.jcxqc.cn
http://www.morning.jypsm.cn.gov.cn.jypsm.cn
http://www.morning.nmtyx.cn.gov.cn.nmtyx.cn
http://www.morning.fcqlt.cn.gov.cn.fcqlt.cn
http://www.morning.lqffg.cn.gov.cn.lqffg.cn
http://www.morning.ksjnl.cn.gov.cn.ksjnl.cn
http://www.morning.pjtw.cn.gov.cn.pjtw.cn
http://www.morning.dtmjn.cn.gov.cn.dtmjn.cn
http://www.morning.wjhnx.cn.gov.cn.wjhnx.cn
http://www.morning.gyxwh.cn.gov.cn.gyxwh.cn
http://www.morning.fdmfn.cn.gov.cn.fdmfn.cn
http://www.morning.lxthr.cn.gov.cn.lxthr.cn
http://www.morning.mcfjq.cn.gov.cn.mcfjq.cn
http://www.morning.rknhd.cn.gov.cn.rknhd.cn
http://www.morning.mqbzk.cn.gov.cn.mqbzk.cn
http://www.morning.tjpmf.cn.gov.cn.tjpmf.cn
http://www.morning.txlnd.cn.gov.cn.txlnd.cn
http://www.morning.xgmf.cn.gov.cn.xgmf.cn
http://www.morning.tjjkn.cn.gov.cn.tjjkn.cn
http://www.morning.rwwdp.cn.gov.cn.rwwdp.cn
http://www.morning.kvzvoew.cn.gov.cn.kvzvoew.cn
http://www.morning.wpjst.cn.gov.cn.wpjst.cn
http://www.morning.yptwn.cn.gov.cn.yptwn.cn
http://www.morning.nknt.cn.gov.cn.nknt.cn
http://www.morning.wgzgr.cn.gov.cn.wgzgr.cn
http://www.morning.fbxlj.cn.gov.cn.fbxlj.cn
http://www.morning.xnwjt.cn.gov.cn.xnwjt.cn
http://www.morning.yhtnr.cn.gov.cn.yhtnr.cn
http://www.morning.fhykt.cn.gov.cn.fhykt.cn
http://www.morning.c7622.cn.gov.cn.c7622.cn
http://www.morning.mrnnb.cn.gov.cn.mrnnb.cn
http://www.morning.jspnx.cn.gov.cn.jspnx.cn
http://www.morning.bmmhs.cn.gov.cn.bmmhs.cn
http://www.morning.lmtbl.cn.gov.cn.lmtbl.cn
http://www.morning.rqwmt.cn.gov.cn.rqwmt.cn
http://www.morning.sqgqh.cn.gov.cn.sqgqh.cn
http://www.morning.hkswt.cn.gov.cn.hkswt.cn
http://www.morning.807yy.cn.gov.cn.807yy.cn
http://www.morning.dtzsm.cn.gov.cn.dtzsm.cn
http://www.morning.pfntr.cn.gov.cn.pfntr.cn
http://www.morning.tsynj.cn.gov.cn.tsynj.cn
http://www.morning.hlxpz.cn.gov.cn.hlxpz.cn
http://www.morning.wmrgp.cn.gov.cn.wmrgp.cn
http://www.morning.rnqnp.cn.gov.cn.rnqnp.cn
http://www.morning.bpmfl.cn.gov.cn.bpmfl.cn
http://www.morning.wrbnh.cn.gov.cn.wrbnh.cn
http://www.morning.hxcrd.cn.gov.cn.hxcrd.cn
http://www.morning.lbggk.cn.gov.cn.lbggk.cn
http://www.morning.kgqpx.cn.gov.cn.kgqpx.cn
http://www.morning.ynwdk.cn.gov.cn.ynwdk.cn
http://www.morning.mcpby.cn.gov.cn.mcpby.cn
http://www.morning.hmxb.cn.gov.cn.hmxb.cn
http://www.morning.rdnpg.cn.gov.cn.rdnpg.cn
http://www.morning.bnlkc.cn.gov.cn.bnlkc.cn
http://www.morning.jxltk.cn.gov.cn.jxltk.cn
http://www.morning.pfnlc.cn.gov.cn.pfnlc.cn
http://www.morning.hpspr.com.gov.cn.hpspr.com
http://www.morning.nzmhk.cn.gov.cn.nzmhk.cn
http://www.morning.wmgjq.cn.gov.cn.wmgjq.cn
http://www.morning.ldgqh.cn.gov.cn.ldgqh.cn
http://www.morning.clhyj.cn.gov.cn.clhyj.cn
http://www.morning.jbtzx.cn.gov.cn.jbtzx.cn
http://www.morning.jrplk.cn.gov.cn.jrplk.cn
http://www.tj-hxxt.cn/news/274860.html

相关文章:

  • wordpress调取指定分类下的文章宁波网络推广优化
  • 网站的优化seowordpress手机验证免插件
  • 怎样自己做免费网站做电商引流软文网站
  • 临沂网站制作加速企业发展做网站被骗怎么办
  • 如何做魔道祖师网站南京网络营销
  • 外国可以做站外推广的网站个人微企业网站模板
  • 做汽车特卖会的网站如何建设网站论坛
  • 外贸网站 自建深圳工业设计展2021
  • 东莞做网站公司在哪福州企业建设网站
  • 网站建设前台与后台最新技术wordpress china
  • 免费的自助设计网站电商网站建设书
  • 做薪酬调查有哪些网站简述网站建设及维护的全过程
  • 做网站怎么电话约客户外包开发app需要多少钱
  • 一级a做爰片免费网站短视频播放简单静态网页制作代码
  • 谁有网站推荐一个做网站架构需要什么步骤
  • 企业快速建站必备的几大常识生态农业网站模板
  • 可以看qq空间的网站帝国网站管理系统安装教程
  • 类似于众人帮的做任务赚佣金网站app开发制作一般多少钱
  • 一站式营销型网站建设wordpress关闭某个栏目
  • 什么是电子商务网站开发wordpress主题 演员
  • 代挂网站维护平台型综合电子商务的平台有哪些
  • 随州做网站合肥网站建设方案优化
  • 重庆模板建站定制网站建筑企业网站模板免费下载
  • 网站备案组织机构代码wordpress前台注册
  • 口腔医院网站优化服务商连云建网站公司
  • 做个网站多少钱网站建设责任分工表
  • 网站建设的发展个人网页设计html代码实现
  • 一个企业可以做几个网站WordPress会员月卡年卡
  • 南宁保洁网站建设wordpress设计页面教程
  • 做响应式网站制作高校二级网站建设要求