- struts2 向值栈中放数据的三种方式
DouDouZH
一、获取值栈的对象,调用值栈的set方法1、代码ValuesStackAction1.javapackagework.zhangdoudou.Action;importcom.opensymphony.xwork2.ActionContext;importcom.opensymphony.xwork2.ActionSupport;importcom.opensymphony.xwork2.util
- Action获取表单提交数据的三种方式
活着_3840
(1)使用ActionContext类范例:form.jspusename:password:配置struts.xml使用第一种方法:使用ActionConext来获取publicclassFormAcrionextendsActionSupport{ActionContextcontext=ActionContext.getContext();Mapmap=context.getParamter
- OGNL的基本语法与用法
天一i
OGNL表达式的基本语法和基本用法一.OGNL中的#、%和$符号#、%和$符号在OGNL表达式中经常出现,而这三种符号也是开发者不容易掌握和理解的部分。在这里我们简单介绍它们的相应用途。1.#符号的三种用法1)访问非根对象属性,例如示例中的#session.msg表达式,由于Struts2中值栈被视为根对象,所以访问其他非根对象时,需要加#前缀。实际上,#相当于ActionContext.getC
- 如何理解java中的context对象?
贾欣晓
java基础java开发语言
背景java中,常见的Context有很多,例如:ServletContext,ActionContext,ServletActionContext,ApplicationContext,PageContext,SessionContext…常见Context熟悉spring是怎样在web容器中启动起来的。spring的启动过程其实就是其IoC容器的启动过程,对于web程序,IoC容器启动过程即是
- java突然查询不到数据,为什么无法查询到数据解决方法
weixin_39642622
java突然查询不到数据
为什么无法查询到数据Javacodepackagecom.test.action;importjava.util.Map;importcom.opensymphony.xwork2.ActionContext;importcom.opensymphony.xwork2.ActionSupport;importcom.test.service.Iservice;publicclassListUser
- request的实例化
萧瑟朗12138
两种方式:HttpServletRequestrequest=ServletActionContext.getRequest();ActionContextct=ActionContext.getContext();HttpServletRequestrequest=(HttpServletRequest)ct.getServletActionContext.HTTP_REQUEST);
- Spring与Struts的区别
不想当菜鸟了
1.实现机制:struts是基于过滤器实现,springMVC是基于Servlet2.运行速度:struts是多例的,springMVC是单例的(每一次请求,都会创建一个Action对象请求来了以后,struts2创建多少个对象:ActionContext,valuestack,UAction,ActionSuport,ModelDriven。同一个Controller请求,只会创建一个Contr
- 通过struts2实现Http只允许POST请求
HelloGeekCsdn
工作积累JAVAstruts2
前两天工作中需要做安全限制工作,今天把代码整理一下。整体的一个思路就是使用Struts2过滤器拦截请求,反射得到对应请求反正只允许POST请求。先看一下主要拦截器代码:importcom.opensymphony.xwork2.Action;importcom.opensymphony.xwork2.ActionContext;importcom.opensymphony.xwork2.Actio
- Struts2实现与Servlet API交互
骑猪下不来的猴
Struts2API交互
1、间接访问(推荐使用)Struts2提供了ActionContext类,通过ActionContext类访问ServletAPI。通过这种方式只能获得request对象,而得不到response对象。ActionContext类提供的常用方法如下1、publicObjectget(Objectkey):取得HttpServletRequest中key的值;2、voidput(Stringkey,
- request获取地址url中各个部分的方法
向下生长的花
学习笔记urlrequest项目名称获取
http://localhost:8080/coreSvn/bosn/admin/NewsInfo!add.action***************************************ActionContextac=ActionContext.getContext();ServletContextsc=(ServletContext)ac.get(ServletActionConte
- struts2的学习使用(IDEA免费版)
bingbingyihao
struts学习intellij-idea
struts2的学习使用(IDEA免费版)学习教程基本示例示例项目下载编写多个Action及分模块编写xml和导入xmlAction的method写法与通配符写法客户列表页面的显示result的type属性及action的重定向ActionContext及ServletActionContext获取表单数据(代替原来的Servlet利用request获取请求数据)获取表单数据的三种方式添加客户功能
- 浅析Struts2中的OGNL和ValueStack
老歪不歪
strutsjavaservlet
要了解Struts2与OGNL表达式的关系,我们必须先搞清楚以下三个概念:1、ActionContext它是Action运行的上下文环境,Action的多项设置都存放在次,我们每一次Action调用都会创建一个ActionContext。通常情况下我们可以通过静态方法getContext()来获得Action上下文,进而进行其它操作,比如说可以得到request、session、applicati
- 虚幻5新特性之EnhancedInput
Claude的羽毛
#虚幻代码ue5ue4游戏引擎
提要本文是对虚幻5新特性插件EnhancedInput的使用学习和代码框架解读,将会从应用和底层两方面对该系统进行分析。EnhancedInput是对虚幻原生Input系统的拓展,其对输入的处理思路和原Input系统在流程上的思路是一致的。所不同的在于,对一些核心概念进行了提取和抽象,如Action和ActionContext。不仅如此,在新框架的加持下,更多的功能特性可以得到发挥,如点触和持续按
- JAVAEE框架学习——Struts2——Action API 使用
So_ProbuING
ActionAPI通过ActionContext获取不同域对象存放值Objectget(Objectkey)类似于调用HttpServletRequest的getAttribute(Stringname)方法MapgetApplication()返回一个Map对象该对象模拟了应用ServletContext实例staticActionContextgetContext()静态方法获取系统的Acti
- 用户在线登录时长统计
yusimiao
web前端javascriptjsp在线时长统计jsp登录
突然接到个任务,让统计用户连续在线的时长,写个简单的脚本来做个记录:先说一下我的思路:1:用户登录到后台将当前的登录时间放到改用的session信息中2:jsp页面取得当前的系统时间—登录时间得到的差就是在线的时长还是简单的把后台代码贴出来:Datedate=newDate();Longtime=date.getTime();//得到当前时间的毫秒数ActionContext.getContext
- struts2获取 servletAPI的三种方法
凯凯_
1.完全解耦合的方式*如果使用该种方式,Struts2框架中提供了一个类,ActionContext类,该类中提供一些方法,通过方法获取Servlet的API*一些常用的方法如下:1.getParameters()--获取请求参数,相当于request.getParameterMap();2.getSession()--获取的代表session域的Map集合,就相当于操作session域。3.ge
- Java web 学习—struts2高级技术
当时年少_青衣
OGNL表达式自动导航对象的结构并访问和设置对象数据,核心对象是ognl上下文(一个Map容器),可以存放多的对象特点:1.支持对象方法的调用2.支持静态方法的调用3.支持变量的赋值4.可以操作集合数据Struts框架中的OGNLstruts2中ognl作用与struts2中的ActionContext。接收一个action请求时会创建ActionContext对象并实例化获取值栈对象:${use
- Struts2--获取ServletAPI的方式
flyingzh
当我们在使用Struts2的时候,在Action类中要怎么获取我们所需要的ServletApi呢,比如常用的request对象,response对象等,下面介绍三种接口对象的获取的方式1.通过我们的ActionContext来获取ActionContext,把它理解为一个装数据的容器,每次创建Action的时候,同时都会创建一个ActionContext,它用来保存Action执行过程中用到的数据
- JEB脚本之二
vak
转载自:安全客@ACBChttps://www.anquanke.com/post/id/228981目录.DEX交叉引用查询(xref)Native调用查询(calleecaller)Native交叉引用查询Native地址所属查询..DEX交叉引用查询查询DEX中方法的交叉引用信息,使用ActionXrefsData和ActionContext#-*-coding:utf-8-*-fromco
- 简单实现Struts2的权限拦截器
宛如秋兮WanAkiko.
Struts2Struts2interceptorAOP拦截器
Action请求类packageaction;publicclassSystemAction{publicStringexecute(){return"success";}}自定义拦截器packageinterceptors;importcom.opensymphony.xwork2.ActionContext;importcom.opensymphony.xwork2.ActionInvocat
- Struts2入门到精通三——————传值
arronxu1989
三SSH
一、1、新建两个actionUserAction为:packageorg.zttc.itat.action;importorg.apache.struts2.ServletActionContext;importcom.opensymphony.xwork2.ActionContext;publicclassUserAction{privateStringusername;privateStrin
- 自定义拦截器实现参数控制国际化
iteye_8036
Web技术StrutsApacheJSP
简单的一个示例,实现通过页面参数控制国际化,本示例使用struts2自带国际化支持,因此自定义国际化需要在程序中覆盖ActionContext中的Locale,即“ActionContext.setLocale(Locale.myLocale);”.众所周知,在页面上可以通过参数“request_locale”来设置地域信息,请参考I18nInterceptor类。可是某些老系统地域信息参数并不一
- struts2 Interceptor详解
gmemai
struts1
1.在注册页面中(index.jsp)注册一下:2.在登录界面(login.jsp)登录:用户名:密 码:3.登录类:LoginAction.javapackagecom.lzw.action;importjava.util.Map;importcom.opensymphony.xwork2.ActionContext;importcom.opensymphony.xwork
- struts2的登录和退出
刘利新西安
Struts2
freshlydebuggedsource:http://blog.csdn.net/weiyanghuadi/article/details/9081879SessionAware用的是依赖注入。而ActionContext.getContext().getSession()不是。不过,它们的作用是相同的,都是返回一个Map,这跟servletAPI中的HttpSession不一样。下面的例子使
- Struts2保存登陆信息和注销功能例子
liguoyuanshiwo
Struts2保存登陆信息和注销功能例子无论是开发WEB应用还是信息系统,总要遇到需要登录的问题。即使是开放度很高的网站,也需要有这个功能,除非是一些完全静态的网站,没有一点交互的内容。这个是学习笔记,直奔主题。LoginAction类是已经写好了,要记录用户登录的信息,只需要在returnSUCCESS;前面加上以下这段代码就OK了。Mapattibutes=ActionContext.getC
- 如何使用ssh框架实现用户的注销功能
小糖豆巴拉巴拉
struts2
倏然很简单,但是先前犯了一个错误正确代码如下://Useruser=(User)ActionContext.getContext().getSession().get("user");//System.out.println(ActionContext.getContext().getSession());//System.out.println(user.getLoginName());//Ac
- 【SSH+Maven-003】删除部门+更新Bug+用户USER模块+角色Role增删改查模块
秦始皇的天下
SSH+Maven
先来一张表结构1、删除部门0.1抽取通用的方法抽取通用的方法放入BaseAction中/***讲对象放入栈顶*@paramobject*/publicvoidpush(Objectobject){ActionContext.getContext().getValueStack().push(object);}/***将集合放入环境中*@paramstring*@paramdeptList*/pub
- java.lang.NoSuchMethodError: com.opensymphony.xwork2.ActionContext.get(Ljava/lan
caisinan_csdn
异常处理
为了修复Struts2漏洞,这两天将Struts2从2.1.8升级到2.3.28.1,结果替换响应jar包后对ajax返回json类型数据的地方报错。原来是因为jar包冲突导致的。解决办法:这两天用到了json插件,我按照以前的版本加入jsonlugin插件,但是搞了一天struts的action就是不认json插件,第二天换用2.1.6版本的包却可以使用,又换回2.1.8版本还是不行,最后在下载
- 关于[Ljava.lang.String;不能转换为java.lang.String错误
toby王
开发实践
[表示一维数组,[[二维数组“L”代表这个数组是指定引用数据类型的数组.所以说,这个错误是类型转换错误。字符串数组不能转化为字符串。遇到这个错误是在struts2框架的拦截器中,我想从拦截器中得到请求的参数。所以调用了ActionContext的getContext方法。将获得的ActionContext实例调用它的getParameters()方法来得到它所有的参数列表(Map)。再通过map来
- struts2中OGNL和 ValueStack(一)
iteye_10154
Struts2freemarkerServlet框架WebworkStruts
struts2中OGNL和ValueStack(一)学习的时候,总分不清楚在struts2中页面的传值和取值是怎么来完成的,所以从网上搜了很多资料,现在把这些资料总结写,留着以后参考。。看完资料后也大概明白了。。。先分清楚下ActionContext、ValueStack、StackContext三者ActionContext一次Action调用都会创建一个ActionContext调用:Acti
- Enum用法
不懂事的小屁孩
enum
以前的时候知道enum,但是真心不怎么用,在实际开发中,经常会用到以下代码:
protected final static String XJ = "XJ";
protected final static String YHK = "YHK";
protected final static String PQ = "PQ";
- 【Spark九十七】RDD API之aggregateByKey
bit1129
spark
1. aggregateByKey的运行机制
/**
* Aggregate the values of each key, using given combine functions and a neutral "zero value".
* This function can return a different result type
- hive创建表是报错: Specified key was too long; max key length is 767 bytes
daizj
hive
今天在hive客户端创建表时报错,具体操作如下
hive> create table test2(id string);
FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask. MetaException(message:javax.jdo.JDODataSto
- Map 与 JavaBean之间的转换
周凡杨
java自省转换反射
最近项目里需要一个工具类,它的功能是传入一个Map后可以返回一个JavaBean对象。很喜欢写这样的Java服务,首先我想到的是要通过Java 的反射去实现匿名类的方法调用,这样才可以把Map里的值set 到JavaBean里。其实这里用Java的自省会更方便,下面两个方法就是一个通过反射,一个通过自省来实现本功能。
1:JavaBean类
1 &nb
- java连接ftp下载
g21121
java
有的时候需要用到java连接ftp服务器下载,上传一些操作,下面写了一个小例子。
/** ftp服务器地址 */
private String ftpHost;
/** ftp服务器用户名 */
private String ftpName;
/** ftp服务器密码 */
private String ftpPass;
/** ftp根目录 */
private String f
- web报表工具FineReport使用中遇到的常见报错及解决办法(二)
老A不折腾
finereportweb报表java报表总结
抛砖引玉,希望大家能把自己整理的问题及解决方法晾出来,Mark一下,利人利己。
出现问题先搜一下文档上有没有,再看看度娘有没有,再看看论坛有没有。有报错要看日志。下面简单罗列下常见的问题,大多文档上都有提到的。
1、没有返回数据集:
在存储过程中的操作语句之前加上set nocount on 或者在数据集exec调用存储过程的前面加上这句。当S
- linux 系统cpu 内存等信息查看
墙头上一根草
cpu内存liunx
1 查看CPU
1.1 查看CPU个数
# cat /proc/cpuinfo | grep "physical id" | uniq | wc -l
2
**uniq命令:删除重复行;wc –l命令:统计行数**
1.2 查看CPU核数
# cat /proc/cpuinfo | grep "cpu cores" | u
- Spring中的AOP
aijuans
springAOP
Spring中的AOP
Written by Tony Jiang @ 2012-1-18 (转)何为AOP
AOP,面向切面编程。
在不改动代码的前提下,灵活的在现有代码的执行顺序前后,添加进新规机能。
来一个简单的Sample:
目标类:
[java]
view plain
copy
print
?
package&nb
- placeholder(HTML 5) IE 兼容插件
alxw4616
JavaScriptjquery jQuery插件
placeholder 这个属性被越来越频繁的使用.
但为做HTML 5 特性IE没能实现这东西.
以下的jQuery插件就是用来在IE上实现该属性的.
/**
* [placeholder(HTML 5) IE 实现.IE9以下通过测试.]
* v 1.0 by oTwo 2014年7月31日 11:45:29
*/
$.fn.placeholder = function
- Object类,值域,泛型等总结(适合有基础的人看)
百合不是茶
泛型的继承和通配符变量的值域Object类转换
java的作用域在编程的时候经常会遇到,而我经常会搞不清楚这个
问题,所以在家的这几天回忆一下过去不知道的每个小知识点
变量的值域;
package 基础;
/**
* 作用域的范围
*
* @author Administrator
*
*/
public class zuoyongyu {
public static vo
- JDK1.5 Condition接口
bijian1013
javathreadConditionjava多线程
Condition 将 Object 监视器方法(wait、notify和 notifyAll)分解成截然不同的对象,以便通过将这些对象与任意 Lock 实现组合使用,为每个对象提供多个等待 set (wait-set)。其中,Lock 替代了 synchronized 方法和语句的使用,Condition 替代了 Object 监视器方法的使用。
条件(也称为条件队列或条件变量)为线程提供了一
- 开源中国OSC源创会记录
bijian1013
hadoopsparkMemSQL
一.Strata+Hadoop World(SHW)大会
是全世界最大的大数据大会之一。SHW大会为各种技术提供了深度交流的机会,还会看到最领先的大数据技术、最广泛的应用场景、最有趣的用例教学以及最全面的大数据行业和趋势探讨。
二.Hadoop
&nbs
- 【Java范型七】范型消除
bit1129
java
范型是Java1.5引入的语言特性,它是编译时的一个语法现象,也就是说,对于一个类,不管是范型类还是非范型类,编译得到的字节码是一样的,差别仅在于通过范型这种语法来进行编译时的类型检查,在运行时是没有范型或者类型参数这个说法的。
范型跟反射刚好相反,反射是一种运行时行为,所以编译时不能访问的变量或者方法(比如private),在运行时通过反射是可以访问的,也就是说,可见性也是一种编译时的行为,在
- 【Spark九十四】spark-sql工具的使用
bit1129
spark
spark-sql是Spark bin目录下的一个可执行脚本,它的目的是通过这个脚本执行Hive的命令,即原来通过
hive>输入的指令可以通过spark-sql>输入的指令来完成。
spark-sql可以使用内置的Hive metadata-store,也可以使用已经独立安装的Hive的metadata store
关于Hive build into Spark
- js做的各种倒计时
ronin47
js 倒计时
第一种:精确到秒的javascript倒计时代码
HTML代码:
<form name="form1">
<div align="center" align="middle"
- java-37.有n 个长为m+1 的字符串,如果某个字符串的最后m 个字符与某个字符串的前m 个字符匹配,则两个字符串可以联接
bylijinnan
java
public class MaxCatenate {
/*
* Q.37 有n 个长为m+1 的字符串,如果某个字符串的最后m 个字符与某个字符串的前m 个字符匹配,则两个字符串可以联接,
* 问这n 个字符串最多可以连成一个多长的字符串,如果出现循环,则返回错误。
*/
public static void main(String[] args){
- mongoDB安装
开窍的石头
mongodb安装 基本操作
mongoDB的安装
1:mongoDB下载 https://www.mongodb.org/downloads
2:下载mongoDB下载后解压
 
- [开源项目]引擎的关键意义
comsci
开源项目
一个系统,最核心的东西就是引擎。。。。。
而要设计和制造出引擎,最关键的是要坚持。。。。。。
现在最先进的引擎技术,也是从莱特兄弟那里出现的,但是中间一直没有断过研发的
 
- 软件度量的一些方法
cuiyadll
方法
软件度量的一些方法http://cuiyingfeng.blog.51cto.com/43841/6775/在前面我们已介绍了组成软件度量的几个方面。在这里我们将先给出关于这几个方面的一个纲要介绍。在后面我们还会作进一步具体的阐述。当我们不从高层次的概念级来看软件度量及其目标的时候,我们很容易把这些活动看成是不同而且毫不相干的。我们现在希望表明他们是怎样恰如其分地嵌入我们的框架的。也就是我们度量的
- XSD中的targetNameSpace解释
darrenzhu
xmlnamespacexsdtargetnamespace
参考链接:
http://blog.csdn.net/colin1014/article/details/357694
xsd文件中定义了一个targetNameSpace后,其内部定义的元素,属性,类型等都属于该targetNameSpace,其自身或外部xsd文件使用这些元素,属性等都必须从定义的targetNameSpace中找:
例如:以下xsd文件,就出现了该错误,即便是在一
- 什么是RAID0、RAID1、RAID0+1、RAID5,等磁盘阵列模式?
dcj3sjt126com
raid
RAID 1又称为Mirror或Mirroring,它的宗旨是最大限度的保证用户数据的可用性和可修复性。 RAID 1的操作方式是把用户写入硬盘的数据百分之百地自动复制到另外一个硬盘上。由于对存储的数据进行百分之百的备份,在所有RAID级别中,RAID 1提供最高的数据安全保障。同样,由于数据的百分之百备份,备份数据占了总存储空间的一半,因而,Mirror的磁盘空间利用率低,存储成本高。
Mir
- yii2 restful web服务快速入门
dcj3sjt126com
PHPyii2
快速入门
Yii 提供了一整套用来简化实现 RESTful 风格的 Web Service 服务的 API。 特别是,Yii 支持以下关于 RESTful 风格的 API:
支持 Active Record 类的通用API的快速原型
涉及的响应格式(在默认情况下支持 JSON 和 XML)
支持可选输出字段的定制对象序列化
适当的格式的数据采集和验证错误
- MongoDB查询(3)——内嵌文档查询(七)
eksliang
MongoDB查询内嵌文档MongoDB查询内嵌数组
MongoDB查询内嵌文档
转载请出自出处:http://eksliang.iteye.com/blog/2177301 一、概述
有两种方法可以查询内嵌文档:查询整个文档;针对键值对进行查询。这两种方式是不同的,下面我通过例子进行分别说明。
二、查询整个文档
例如:有如下文档
db.emp.insert({
&qu
- android4.4从系统图库无法加载图片的问题
gundumw100
android
典型的使用场景就是要设置一个头像,头像需要从系统图库或者拍照获得,在android4.4之前,我用的代码没问题,但是今天使用android4.4的时候突然发现不灵了。baidu了一圈,终于解决了。
下面是解决方案:
private String[] items = new String[] { "图库","拍照" };
/* 头像名称 */
- 网页特效大全 jQuery等
ini
JavaScriptjquerycsshtml5ini
HTML5和CSS3知识和特效
asp.net ajax jquery实例
分享一个下雪的特效
jQuery倾斜的动画导航菜单
选美大赛示例 你会选谁
jQuery实现HTML5时钟
功能强大的滚动播放插件JQ-Slide
万圣节快乐!!!
向上弹出菜单jQuery插件
htm5视差动画
jquery将列表倒转顺序
推荐一个jQuery分页插件
jquery animate
- swift objc_setAssociatedObject block(version1.2 xcode6.4)
啸笑天
version
import UIKit
class LSObjectWrapper: NSObject {
let value: ((barButton: UIButton?) -> Void)?
init(value: (barButton: UIButton?) -> Void) {
self.value = value
- Aegis 默认的 Xfire 绑定方式,将 XML 映射为 POJO
MagicMa_007
javaPOJOxmlAegisxfire
Aegis 是一个默认的 Xfire 绑定方式,它将 XML 映射为 POJO, 支持代码先行的开发.你开发服 务类与 POJO,它为你生成 XML schema/wsdl
XML 和 注解映射概览
默认情况下,你的 POJO 类被是基于他们的名字与命名空间被序列化。如果
- js get max value in (json) Array
qiaolevip
每天进步一点点学习永无止境max纵观千象
// Max value in Array
var arr = [1,2,3,5,3,2];Math.max.apply(null, arr); // 5
// Max value in Jaon Array
var arr = [{"x":"8/11/2009","y":0.026572007},{"x"
- XMLhttpRequest 请求 XML,JSON ,POJO 数据
Luob.
POJOjsonAjaxxmlXMLhttpREquest
在使用XMlhttpRequest对象发送请求和响应之前,必须首先使用javaScript对象创建一个XMLHttpRquest对象。
var xmlhttp;
function getXMLHttpRequest(){
if(window.ActiveXObject){
xmlhttp:new ActiveXObject("Microsoft.XMLHTTP
- jquery
wuai
jquery
以下防止文档在完全加载之前运行Jquery代码,否则会出现试图隐藏一个不存在的元素、获得未完全加载的图像的大小 等等
$(document).ready(function(){
jquery代码;
});
<script type="text/javascript" src="c:/scripts/jquery-1.4.2.min.js&quo