和配置文件相对应的代码(struts1)

public void process(HttpServletRequest request, HttpServletResponse response)
        throws IOException, ServletException {
        // Wrap multipart requests with a special wrapper
        request = processMultipart(request);

// Identify the path component we will use to select a mapping
        String path = processPath(request, response);

if (path == null) {
            return;
        }

if (log.isDebugEnabled()) {
            log.debug("Processing a '" + request.getMethod() + "' for path '"
                + path + "'");
        }

// Select a Locale for the current user if requested
        processLocale(request, response);

// Set the content type and no-caching headers if requested
        processContent(request, response);
        processNoCache(request, response);

// General purpose preprocessing hook
        if (!processPreprocess(request, response)) {
            return;
        }

this.processCachedMessages(request, response);

// Identify the mapping for this request
        ActionMapping mapping = processMapping(request, response, path);

if (mapping == null) {
            return;
        }

// Check for any role required to perform this action
        if (!processRoles(request, response, mapping)) {
            return;
        }

// Process any ActionForm bean related to this request
        ActionForm form = processActionForm(request, response, mapping);

processPopulate(request, response, form, mapping);

// Validate any fields of the ActionForm bean, if applicable
        try {
            if (!processValidate(request, response, form, mapping)) {
                return;
            }
        } catch (InvalidCancelException e) {
            ActionForward forward = processException(request, response, e, form, mapping);
            processForwardConfig(request, response, forward);
            return;
        } catch (IOException e) {
            throw e;
        } catch (ServletException e) {
            throw e;
        }

// Process a forward or include specified by this mapping
        if (!processForward(request, response, mapping)) {
            return;
        }

if (!processInclude(request, response, mapping)) {
            return;
        }

// Create or acquire the Action instance to process this request
        Action action = processActionCreate(request, response, mapping);

if (action == null) {
            return;
        }

// Call the Action instance itself
        ActionForward forward =
            processActionPerform(request, response, action, form, mapping);

// Process the returned ActionForward instance
        processForwardConfig(request, response, forward);
    }

转载于:https://www.cnblogs.com/davidwang456/p/3164217.html

struts深入原理之RequestProcessor与xml相关推荐

  1. Struts工作原理及其优缺点详解

    2019独角兽企业重金招聘Python工程师标准>>> 一.Struts工作原理 MVC即Model-View-Controller的缩写,是一种常用的设计模式.MVC 减弱了业务逻 ...

  2. struts工作原理(图解)

    Struts2框架的工作原理: 1.服务器启动,会加载我们的xml配置文件中的内容. 2.服务器启动之后,过来一个servlet请求,如user类中的save方法.请求过来先过过滤器(strutsPr ...

  3. Struts工作原理

    MVC即Model-View-Controller的缩写,是一种常用的设计模式.MVC 减弱了业务逻辑接口和数据接口之间的耦合,以及让视图层更富于变化. Struts 是MVC的一种实现,它将 Ser ...

  4. Struts1——离BeanUtils看struts其原理1

    在Struts中非常典型的特点就是使用了ActionForm来搜集表单数据,可是搜集到的表单数据所有都是String类型的.假设我们直接拿来使用我们会面临一个非常麻烦的问题就是频繁的类型装换. Str ...

  5. 【SpringMVC 笔记】SpringMVC 原理 + 入门项目(xml 配置版 vs 注解版)

    SpringMVC 入门项目 什么是 SpringMVC? 中心控制器 SpringMVC 执行原理 执行流程 xml 配置版 1.创建一个 Web 项目 2.pom.xml 中导入 SpringMV ...

  6. SSH深度历险(十一) AOP原理及相关概念学习+xml配置实例(对照注解方式的优缺点)...

    接上一篇 SSH深度历险(十) AOP原理及相关概念学习+AspectJ注解方式配置spring AOP,本篇我们主要是来学习使用配置XML实现AOP 本文採用强制的CGLB代理方式 Security ...

  7. struts2中struts.xml和web.xml文件解析及工作原理

    转自:https://www.cnblogs.com/printN/p/6434526.html web.xml <?xml version="1.0" encoding=& ...

  8. struts2.1.6教程二、struts.xml配置及例程

    1.配置文件的优先级 在struts2中一些配置(比如常量)可以同时在struts-default.xml(只读性),strtus-plguin.xml(只读性),struts.xml,struts. ...

  9. java struts 介绍_Struts简介、原理及简单实现

    struts简介 Struts是Apache软件基金会(ASF)赞助的一个开源项目.它最初是jakarta项目中的一个子项目,并在2004年3月成为ASF的顶级项目.它通过采用JavaServlet/ ...

最新文章

  1. java获取达梦数据库_Java连接达梦数据库驱动dm_jdbc
  2. “package ‘ElemStatLearn‘ is not available for this version of R
  3. 【c语言】蓝桥杯算法提高 3-2字符串输入输出函数
  4. linux 文件夹隐藏属性,Linux基础知识之文件隐藏属性
  5. 腾讯2016春招之算法编程解析
  6. pvr波形是什么意思_PVR的完整形式是什么?
  7. 活动地推怎么做最有效?
  8. android studio查看jar包源码,Android Studio查看源代码报错
  9. [Python3] 初识py, 一个简单练手的小玩意. 快递查询
  10. html5页面登录页面,html5练习——登录页面
  11. vmware 文件夹共享
  12. 5分钟带你了解Python中的容器型数据类型--列表1
  13. 这年头Windows电脑还需要杀毒软件吗?
  14. Intelsat-29e卫星解体全损,威胁地球静止轨道安全
  15. 学java难不难?java应该怎么学?
  16. YOLOv5实现目标识别全流程【超级详细!】
  17. 使用mysql查询显示行号
  18. 中兴核心网服务器笔记本电脑,基于统一硬件平台的中兴通讯核心网技术介绍
  19. 《JavaScript百炼成仙》第三次送书活动~
  20. html登录号如何显示用户名,HTML更改登录标签,登录后用户名

热门文章

  1. thinkphp php resque,麻花儿
  2. gettext()方法输出空白_如何将文档内容输出为无水印图片?超简单的操作方法看这里...
  3. 计算机网络按定义分,计算机网络定义及其分类
  4. qt布局嵌套_PyQt5 笔记(01):嵌套布局
  5. C#中类的属性(Property)
  6. JAVA 之反射(基础概念) 几个主要常用的重要的方法
  7. android实现跑马灯效果(最小集代码)
  8. C++基本序列式容器效率比较
  9. kibana. 登陆
  10. 60. Leetcode 面试题 10.03. 搜索旋转数组 (二分查找-局部有序)