随笔分类 -  struts

ActionContext详解
摘要:ActionContext ActionContext是Action的上下文,Struts2自动在其中保存了一些在Action执行过程中所需的对象,比如session, parameters, locale等。Struts2会根据每个执行HTTP请求的线程来创建对应的ActionContext,即一... 阅读全文

posted @ 2014-09-09 15:41 锟斤拷锟斤拷 阅读(3827) 评论(1) 推荐(2)

ActionContext表格总结
摘要:用一张表格来总结:变量从ActionContext中获得生命周期用Ongl来读取值使用ServletConfigInterceptor来注入ActionContext类静态方法ActionContext. getContext()一次Http请求使用“#”加上key,如“#name”无法注入Val... 阅读全文

posted @ 2014-09-09 15:34 锟斤拷锟斤拷 阅读(372) 评论(0) 推荐(0)

Struts2中s:set标签和s:if标签小结
摘要:1、s:set标签格式:说明:把jsp页面中的一个值,以name存储起来。Scope存储的范围是在application、session、request、page……。默认是存储在该action中。用法①:这个值是一个list容器,迭代使用s:iterator标签,Notice:list、set容器... 阅读全文

posted @ 2014-07-10 11:47 锟斤拷锟斤拷 阅读(222) 评论(0) 推荐(0)

Result实现类
摘要:package org.apache.struts2.dispatcher;import com.opensymphony.xwork2.ActionInvocation;import com.opensymphony.xwork2.Result;import com.opensymphony.xw... 阅读全文

posted @ 2014-04-28 21:59 锟斤拷锟斤拷 阅读(230) 评论(0) 推荐(0)

ActionProxy相关实现类
摘要:package com.opensymphony.xwork2;import com.opensymphony.xwork2.config.Configuration;import com.opensymphony.xwork2.config.ConfigurationException;impor... 阅读全文

posted @ 2014-04-28 21:03 锟斤拷锟斤拷 阅读(1062) 评论(0) 推荐(0)

DefaultActionInvocation 源码
摘要:/** * Copyright 2002-2006,2009 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use ... 阅读全文

posted @ 2014-04-28 20:39 锟斤拷锟斤拷 阅读(533) 评论(0) 推荐(0)

struts2知识系统整理
摘要:1.MVC 和 JSP Model 2 ** a.:M-Model 模型 包含两部分:业务数据和业务处理逻辑 b.V-View 视图:视图(View)的职责是负责显示界面和用户交互(收集用户信息)。 c.C-Controller 控制器 项目中写的ActionServlet。-----------... 阅读全文

posted @ 2014-04-28 17:40 锟斤拷锟斤拷 阅读(347) 评论(0) 推荐(1)

PreResultListener
摘要:PreResultListener是要给监听器接口,他可以在Action完成控制处理之后,系统转入实际的物理视图之间被回调。 Struts 2 可以由ActionInvocation的addPreResultListener()方法来完成。 Struts 2 可以由Action和拦截器添加PreRe... 阅读全文

posted @ 2014-04-23 09:47 锟斤拷锟斤拷 阅读(311) 评论(0) 推荐(0)

struts2和spring的两种整合方式
摘要:首先,来看看如何让Spring 来管理Action.在struts.xml中加入有两种整合方式:(1) 把Action配置在beans.xml里,利用Spring初始化Action的bean:将Struts的业务逻辑控制器类配置在Spring的配置文件中,Action中引用的业务类一并注入。 (这样... 阅读全文

posted @ 2014-04-21 14:42 锟斤拷锟斤拷 阅读(147) 评论(0) 推荐(0)

Struts2拦截器原理
摘要:拦截器是struts2处理的核心,本文主要说struts2的拦截器的基本原理/实现,其它框架处理的东西就不说了,得自己再看了。struts2版本:2.2.3当一个请求来了后,从org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecut... 阅读全文

posted @ 2014-04-15 17:59 锟斤拷锟斤拷 阅读(371) 评论(0) 推荐(0)

Struts2拦截器
摘要:拦截器(interceptor)是Struts2最强大的特性之一,拦截器可以让你在Action和result被执行之前或之后进行一些处理。同时,拦截器也可以让你将通用的代码模块化并作为可重用的类。Struts2中的很多特性都是由拦截器来完成的。例如params拦截器将HTTP请求中的参数解析出来,并... 阅读全文

posted @ 2014-04-15 16:54 锟斤拷锟斤拷 阅读(191) 评论(0) 推荐(0)

Struts2中 ValueStack、ActionContext、ServletContext、request、session等 表格解析
摘要:变量从ActionContext中获得生命周期用Ongl来读取值使用ServletConfigInterceptor来注入ActionContext类静态方法ActionContext. getContext()一次Http请求使用“#”加上key,如“#name”无法注入ValueStack类ActionContext. getValueStack()一次Http请求直接填写来访问栈中对象的方法,或者使用top来直接获得栈中对象无法注入HttpServletRequest类ActionContext. get( StrutsStatics. HTTP_REQUEST)一次Http请求无方便的 阅读全文

posted @ 2014-04-10 15:36 锟斤拷锟斤拷 阅读(260) 评论(0) 推荐(0)

Struts2请求处理流程及源码分析
摘要:1.1 Struts2请求处理1. 一个请求在Struts2框架中的处理步骤:a) 客户端初始化一个指向Servlet容器的请求;b) 根据Web.xml配置,请求首先经过ActionContextCleanUp过滤器,其为可选过滤器,这个过滤器对于Struts2和其他框架的集成很有帮助(SiteMesh Plugin),主要清理当前线程的ActionContext和Dispatcher;c) 请求经过插件过滤器,如:SiteMesh、etc等过滤器;d) 请求经过核心过滤器FilterDispatcher,执行doFilter方法,在该方法中,询问ActionMapper来决定这个请求是否需 阅读全文

posted @ 2014-04-09 13:35 锟斤拷锟斤拷 阅读(207) 评论(0) 推荐(0)

Struts2请求流程
摘要:1. 一个请求在Struts2框架中的处理步骤:a) 客户端初始化一个指向Servlet容器的请求;b) 根据Web.xml配置,请求首先经过ActionContextCleanUp过滤器,其为可选过滤器,这个过滤器对于Struts2和其他框架的集成很有帮助(SiteMesh Plugin),主要清理当前线程的ActionContext和Dispatcher;c) 请求经过插件过滤器,如:SiteMesh、etc等过滤器;d) 请求经过核心过滤器FilterDispatcher,执行doFilter方法,在该方法中,询问ActionMapper来决定这个请求是否需要调用某个Action;e) 阅读全文

posted @ 2014-04-09 12:00 锟斤拷锟斤拷 阅读(393) 评论(0) 推荐(0)

struts ValueStack 详解
摘要:一、ValueStack 1.ValueStack是一个接口,在struts2中使用OGNL(Object-Graph Navigation Language)表达式实际上是使用 实现了ValueStack接口的类OgnlValueStack.它是ValueStack的默认实现类. 2.Valu... 阅读全文

posted @ 2014-04-09 10:56 锟斤拷锟斤拷 阅读(1197) 评论(0) 推荐(0)

struts OGNL详解
摘要:首先了解下OGNL的概念:OGNL是Object-Graph Navigation Language的缩写,全称为对象图导航语言,是一种功能强大的表达式语言,它通过简单一致的语法,可以任意存取对象的属性或者调用对象的方法,能够遍历整个对象的结构图,实现对象属性类型的转换等功能。此外,还得先需弄懂OGNL的一些知识:1.OGNL表达式的计算是围绕OGNL上下文进行的。OGNL上下文实际上就是一个Map对象,由ognl.OgnlContext类表示。它里面可以存放很多个JavaBean对象。它有一个上下文根对象。上下文中的根对象可以直接使用名来访问或直接使用它的属性名访问它的属性值。否则要加前缀“ 阅读全文

posted @ 2014-04-09 10:00 锟斤拷锟斤拷 阅读(240) 评论(0) 推荐(0)

Ognl对象图导航语言 源码
摘要:// --------------------------------------------------------------------------// Copyright (c) 1998-2004, Drew Davidson and Luke Blanshard// All rights reserved.//// Redistribution and use in source and binary forms, with or without// modification, are permitted provided that the following conditions 阅读全文

posted @ 2014-04-09 09:57 锟斤拷锟斤拷 阅读(293) 评论(0) 推荐(0)

valuestack 根对象CompoundRoot 源码
摘要:/* * Copyright 2002-2006,2009 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * 阅读全文

posted @ 2014-04-09 09:43 锟斤拷锟斤拷 阅读(260) 评论(0) 推荐(0)

ServletActionContext 源码
摘要:/* * $Id: ServletActionContext.java 651946 2008-04-27 13:41:38Z apetrelli $ * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF .. 阅读全文

posted @ 2014-04-09 09:26 锟斤拷锟斤拷 阅读(310) 评论(0) 推荐(0)

ActionContext源码
摘要:/* * Copyright 2002-2006,2009 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * 阅读全文

posted @ 2014-04-09 09:25 锟斤拷锟斤拷 阅读(228) 评论(0) 推荐(0)

导航