- 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
- TOMCAT在POST方法提交参数丢失问题
357029540
javatomcatjsp
摘自http://my.oschina.net/luckyi/blog/213209
昨天在解决一个BUG时发现一个奇怪的问题,一个AJAX提交数据在之前都是木有问题的,突然提交出错影响其他处理流程。
检查时发现页面处理数据较多,起初以为是提交顺序不正确修改后发现不是由此问题引起。于是删除掉一部分数据进行提交,较少数据能够提交成功。
恢复较多数据后跟踪提交FORM DATA ,发现数
- 在MyEclipse中增加JSP模板 删除-2008-08-18
ljy325
jspxmlMyEclipse
在D:\Program Files\MyEclipse 6.0\myeclipse\eclipse\plugins\com.genuitec.eclipse.wizards_6.0.1.zmyeclipse601200710\templates\jsp 目录下找到Jsp.vtl,复制一份,重命名为jsp2.vtl,然后把里面的内容修改为自己想要的格式,保存。
然后在 D:\Progr
- JavaScript常用验证脚本总结
eksliang
JavaScriptjavaScript表单验证
转载请出自出处:http://eksliang.iteye.com/blog/2098985
下面这些验证脚本,是我在这几年开发中的总结,今天把他放出来,也算是一种分享吧,现在在我的项目中也在用!包括日期验证、比较,非空验证、身份证验证、数值验证、Email验证、电话验证等等...!
&nb
- 微软BI(4)
18289753290
微软BI SSIS
1)
Q:查看ssis里面某个控件输出的结果:
A MessageBox.Show(Dts.Variables["v_lastTimestamp"].Value.ToString());
这是我们在包里面定义的变量
2):在关联目的端表的时候如果是一对多的关系,一定要选择唯一的那个键作为关联字段。
3)
Q:ssis里面如果将多个数据源的数据插入目的端一
- 定时对大数据量的表进行分表对数据备份
酷的飞上天空
大数据量
工作中遇到数据库中一个表的数据量比较大,属于日志表。正常情况下是不会有查询操作的,但如果不进行分表数据太多,执行一条简单sql语句要等好几分钟。。
分表工具:linux的shell + mysql自身提供的管理命令
原理:使用一个和原表数据结构一样的表,替换原表。
linux shell内容如下:
=======================开始 
- 本质的描述与因材施教
永夜-极光
感想随笔
不管碰到什么事,我都下意识的想去探索本质,找寻一个最形象的描述方式。
我坚信,世界上对一件事物的描述和解释,肯定有一种最形象,最贴近本质,最容易让人理解
&
- 很迷茫。。。
随便小屋
随笔
小弟我今年研一,也是从事的咱们现在最流行的专业(计算机)。本科三流学校,为了能有个更好的跳板,进入了考研大军,非常有幸能进入研究生的行业(具体学校就不说了,怕把学校的名誉给损了)。
先说一下自身的条件,本科专业软件工程。主要学习就是软件开发,几乎和计算机没有什么区别。因为学校本身三流,也就是让老师带着学生学点东西,然后让学生毕业就行了。对专业性的东西了解的非常浅。就那学的语言来说
- 23种设计模式的意图和适用范围
aijuans
设计模式
Factory Method 意图 定义一个用于创建对象的接口,让子类决定实例化哪一个类。Factory Method 使一个类的实例化延迟到其子类。 适用性 当一个类不知道它所必须创建的对象的类的时候。 当一个类希望由它的子类来指定它所创建的对象的时候。 当类将创建对象的职责委托给多个帮助子类中的某一个,并且你希望将哪一个帮助子类是代理者这一信息局部化的时候。
Abstr
- Java中的synchronized和volatile
aoyouzi
javavolatilesynchronized
说到Java的线程同步问题肯定要说到两个关键字synchronized和volatile。说到这两个关键字,又要说道JVM的内存模型。JVM里内存分为main memory和working memory。 Main memory是所有线程共享的,working memory则是线程的工作内存,它保存有部分main memory变量的拷贝,对这些变量的更新直接发生在working memo
- js数组的操作和this关键字
百合不是茶
js数组操作this关键字
js数组的操作;
一:数组的创建:
1、数组的创建
var array = new Array(); //创建一个数组
var array = new Array([size]); //创建一个数组并指定长度,注意不是上限,是长度
var arrayObj = new Array([element0[, element1[, ...[, elementN]]]
- 别人的阿里面试感悟
bijian1013
面试分享工作感悟阿里面试
原文如下:http://greemranqq.iteye.com/blog/2007170
一直做企业系统,虽然也自己一直学习技术,但是感觉还是有所欠缺,准备花几个月的时间,把互联网的东西,以及一些基础更加的深入透析,结果这次比较意外,有点突然,下面分享一下感受吧!
&nb
- 淘宝的测试框架Itest
Bill_chen
springmaven框架单元测试JUnit
Itest测试框架是TaoBao测试部门开发的一套单元测试框架,以Junit4为核心,
集合DbUnit、Unitils等主流测试框架,应该算是比较好用的了。
近期项目中用了下,有关itest的具体使用如下:
1.在Maven中引入itest框架:
<dependency>
<groupId>com.taobao.test</groupId&g
- 【Java多线程二】多路条件解决生产者消费者问题
bit1129
java多线程
package com.tom;
import java.util.LinkedList;
import java.util.Queue;
import java.util.concurrent.ThreadLocalRandom;
import java.util.concurrent.locks.Condition;
import java.util.concurrent.loc
- 汉字转拼音pinyin4j
白糖_
pinyin4j
以前在项目中遇到汉字转拼音的情况,于是在网上找到了pinyin4j这个工具包,非常有用,别的不说了,直接下代码:
import java.util.HashSet;
import java.util.Set;
import net.sourceforge.pinyin4j.PinyinHelper;
import net.sourceforge.pinyin
- org.hibernate.TransactionException: JDBC begin failed解决方案
bozch
ssh数据库异常DBCP
org.hibernate.TransactionException: JDBC begin failed: at org.hibernate.transaction.JDBCTransaction.begin(JDBCTransaction.java:68) at org.hibernate.impl.SessionImp
- java-并查集(Disjoint-set)-将多个集合合并成没有交集的集合
bylijinnan
java
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.ut
- Java PrintWriter打印乱码
chenbowen00
java
一个小程序读写文件,发现PrintWriter输出后文件存在乱码,解决办法主要统一输入输出流编码格式。
读文件:
BufferedReader
从字符输入流中读取文本,缓冲各个字符,从而提供字符、数组和行的高效读取。
可以指定缓冲区的大小,或者可使用默认的大小。大多数情况下,默认值就足够大了。
通常,Reader 所作的每个读取请求都会导致对基础字符或字节流进行相应的读取请求。因
- [天气与气候]极端气候环境
comsci
环境
如果空间环境出现异变...外星文明并未出现,而只是用某种气象武器对地球的气候系统进行攻击,并挑唆地球国家间的战争,经过一段时间的准备...最大限度的削弱地球文明的整体力量,然后再进行入侵......
那么地球上的国家应该做什么样的防备工作呢?
&n
- oracle order by与union一起使用的用法
daizj
UNIONoracleorder by
当使用union操作时,排序语句必须放在最后面才正确,如下:
只能在union的最后一个子查询中使用order by,而这个order by是针对整个unioning后的结果集的。So:
如果unoin的几个子查询列名不同,如
Sql代码
select supplier_id, supplier_name
from suppliers
UNI
- zeus持久层读写分离单元测试
deng520159
单元测试
本文是zeus读写分离单元测试,距离分库分表,只有一步了.上代码:
1.ZeusMasterSlaveTest.java
package com.dengliang.zeus.webdemo.test;
import java.util.ArrayList;
import java.util.List;
import org.junit.Assert;
import org.j
- Yii 截取字符串(UTF-8) 使用组件
dcj3sjt126com
yii
1.将Helper.php放进protected\components文件夹下。
2.调用方法:
Helper::truncate_utf8_string($content,20,false); //不显示省略号 Helper::truncate_utf8_string($content,20); //显示省略号
&n
- 安装memcache及php扩展
dcj3sjt126com
PHP
安装memcache tar zxvf memcache-2.2.5.tgz cd memcache-2.2.5/ /usr/local/php/bin/phpize (?) ./configure --with-php-confi
- JsonObject 处理日期
feifeilinlin521
javajsonJsonOjbectJsonArrayJSONException
写这边文章的初衷就是遇到了json在转换日期格式出现了异常 net.sf.json.JSONException: java.lang.reflect.InvocationTargetException 原因是当你用Map接收数据库返回了java.sql.Date 日期的数据进行json转换出的问题话不多说 直接上代码
&n
- Ehcache(06)——监听器
234390216
监听器listenerehcache
监听器
Ehcache中监听器有两种,监听CacheManager的CacheManagerEventListener和监听Cache的CacheEventListener。在Ehcache中,Listener是通过对应的监听器工厂来生产和发生作用的。下面我们将来介绍一下这两种类型的监听器。
- activiti 自带设计器中chrome 34版本不能打开bug的解决
jackyrong
Activiti
在acitivti modeler中,如果是chrome 34,则不能打开该设计器,其他浏览器可以,
经证实为bug,参考
http://forums.activiti.org/content/activiti-modeler-doesnt-work-chrome-v34
修改为,找到
oryx.debug.js
在最头部增加
if (!Document.
- 微信收货地址共享接口-终极解决
laotu5i0
微信开发
最近要接入微信的收货地址共享接口,总是不成功,折腾了好几天,实在没办法网上搜到的帖子也是骂声一片。我把我碰到并解决问题的过程分享出来,希望能给微信的接口文档起到一个辅助作用,让后面进来的开发者能快速的接入,而不需要像我们一样苦逼的浪费好几天,甚至一周的青春。各种羞辱、谩骂的话就不说了,本人还算文明。
如果你能搜到本贴,说明你已经碰到了各种 ed
- 关于人才
netkiller.github.com
工作面试招聘netkiller人才
关于人才
每个月我都会接到许多猎头的电话,有些猎头比较专业,但绝大多数在我看来与猎头二字还是有很大差距的。 与猎头接触多了,自然也了解了他们的工作,包括操作手法,总体上国内的猎头行业还处在初级阶段。
总结就是“盲目推荐,以量取胜”。
目前现状
许多从事人力资源工作的人,根本不懂得怎么找人才。处在人才找不到企业,企业找不到人才的尴尬处境。
企业招聘,通常是需要用人的部门提出招聘条件,由人
- 搭建 CentOS 6 服务器 - 目录
rensanning
centos
(1) 安装CentOS
ISO(desktop/minimal)、Cloud(AWS/阿里云)、Virtualization(VMWare、VirtualBox)
详细内容
(2) Linux常用命令
cd、ls、rm、chmod......
详细内容
(3) 初始环境设置
用户管理、网络设置、安全设置......
详细内容
(4) 常驻服务Daemon
- 【求助】mongoDB无法更新主键
toknowme
mongodb
Query query = new Query(); query.addCriteria(new Criteria("_id").is(o.getId())); &n
- jquery 页面滚动到底部自动加载插件集合
xp9802
jquery
很多社交网站都使用无限滚动的翻页技术来提高用户体验,当你页面滑到列表底部时候无需点击就自动加载更多的内容。下面为你推荐 10 个 jQuery 的无限滚动的插件:
1. jQuery ScrollPagination
jQuery ScrollPagination plugin 是一个 jQuery 实现的支持无限滚动加载数据的插件。
2. jQuery Screw
S