和配置文件相对应的代码(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);
    }

struts深入原理之RequestProcessor与xml的更多相关文章

  1. 菜鸟学Struts2——Struts工作原理

    在完成Struts2的HelloWorld后,对Struts2的工作原理进行学习.Struts2框架可以按照模块来划分为Servlet Filters,Struts核心模块,拦截器和用户实现部分,其中 ...

  2. [JavaEE,MVC] Struts工作原理

    基本概念 Struts是Apache 基金会Jakarta 项目组的一个Open Source 项目,它采用MVC模式,能够很好地帮助java 开发者利用J2EE开发Web应用.和其他的java架构一 ...

  3. struts工作原理不错的解释___

    Struts 使用 Model 2 架构.Struts 的ActionServlet 控制导航流.其他Struts 类,比如Action, 用来访问业务逻辑类.当 ActionServlet 从容器接 ...

  4. struts工作原理(图解)

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

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

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

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

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

  7. struts工作原理

    在struts2的应用中,从用户请求到服务器返回相应响应给用户端的过程中,包含了许多组件如:Controller.ActionProxy.ActionMapping.Configuration Man ...

  8. Hibernate、Spring和Struts工作原理及使用理由

    1.读取并解析配置文件2.读取并解析映射信息,创建SessionFactory3.打开Sesssion4.创建事务Transation5.持久化操作6.提交事务7.关闭Session8.关闭Sesst ...

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

    web.xml <?xml version="1.0" encoding="UTF-8"?> <web-app id="WebApp ...

随机推荐

  1. Android中的PopupWindow

    1.功能 PopupWindow这个类用来实现一个弹出框,可以使用任意布局的View作为其内容,这个弹出框是悬浮在当前activity之上的,可以设置显示位置. 2.需求 弹出软键盘,实现键盘功能从而 ...

  2. linux延时关机

    04.shutdown +2 "The machine will shutdown" # 2min 后关机,并通知在线者 05.shutdown -h now 立刻关机,其中now ...

  3. php学习笔记2016.1

    基本类型    PHP是一种弱类型语言.      PHP类型检查函数   is_bool()    is_integer()  is_double()  is_string()   is_objec ...

  4. No prohects are avaliable for deployment to this server

    没有项目可用于部署到该服务器的项目或者所有项目都已部署到该服务器或没有发现项目 报错的就是这样的信息,网上看了很多解决方案,比如:http://ttov.blog.163.com/blog/stati ...

  5. Android 客户端设计之解决方案

    解决方案,是正对与需求来谈的.一个抽象的需求,需要一个较为上层抽象的解决方案来处理,这是病和药的关系.但是一个解决方案,可能会包含多个功能,每个功能都是解决方案上的一个节点.一个优秀的解决方案必然需要 ...

  6. 在Ubuntu13.04中配置Jexus+Mono3.2运行Asp.Net Mvc 4站点 (二)

    开始写这篇前看了看日期,写下这个序列的前一半竟是两个月前的事情了,无比惭愧.这段时间尝试重新组织Mvc4的项目引用,创建了两个项目模板,一个是简单模式,即仅包含Mvc基本功能.另一个是包含了Mvc4 ...

  7. MySQL 5.6.17 rpm 文件安装顺序

     Linux系统安装MySQL时,将MySQL-5.6.17-1.el6.x86_64.rpm-bundle.tar包打开,有7个rpm文件,如下: MySQL-client-5.6.17-1.el6 ...

  8. 使用C#开发ActiveX控件(新)

    前言 ActiveX控件以前也叫做OLE控件,它是微软IE支持的一种软件组件或对象,可以将其插入到Web页面中,实现在浏览器端执行动态程序功能,以增强浏览器端的动态处理能力.通常ActiveX控件都是 ...

  9. windbg 基础命令实战 - 简单程序破解

    以前玩游戏遇到一些实在过不去的管卡,经常会找一些游戏修改软件来修改游戏,让自己变得无比强大,将boss一路砍瓜切菜过足游戏瘾.其实游戏修改软件的功能大多都比较简单,我们可以通过windbg的一些简单命 ...

  10. Fragment提交transaction导致state loss异常

    下面自从Honeycomb发布后,下面栈跟踪信息和异常信息已经困扰了StackOverFlow很久了. java.lang.IllegalStateException: Can not perform ...