- 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
- JVM StackMapTable 属性的作用及理解
lijingyao8206
jvm字节码Class文件StackMapTable
在Java 6版本之后JVM引入了栈图(Stack Map Table)概念。为了提高验证过程的效率,在字节码规范中添加了Stack Map Table属性,以下简称栈图,其方法的code属性中存储了局部变量和操作数的类型验证以及字节码的偏移量。也就是一个method需要且仅对应一个Stack Map Table。在Java 7版
- 回调函数调用方法
百合不是茶
java
最近在看大神写的代码时,.发现其中使用了很多的回调 ,以前只是在学习的时候经常用到 ,现在写个笔记 记录一下
代码很简单:
MainDemo :调用方法 得到方法的返回结果
- [时间机器]制造时间机器需要一些材料
comsci
制造
根据我的计算和推测,要完全实现制造一台时间机器,需要某些我们这个世界不存在的物质
和材料...
甚至可以这样说,这种材料和物质,我们在反应堆中也无法获得......
 
- 开口埋怨不如闭口做事
邓集海
邓集海 做人 做事 工作
“开口埋怨,不如闭口做事。”不是名人名言,而是一个普通父亲对儿子的训导。但是,因为这句训导,这位普通父亲却造就了一个名人儿子。这位普通父亲造就的名人儿子,叫张明正。 张明正出身贫寒,读书时成绩差,常挨老师批评。高中毕业,张明正连普通大学的分数线都没上。高考成绩出来后,平时开口怨这怨那的张明正,不从自身找原因,而是不停地埋怨自己家庭条件不好、埋怨父母没有给他创造良好的学习环境。
- jQuery插件开发全解析,类级别与对象级别开发
IT独行者
jquery开发插件 函数
jQuery插件的开发包括两种: 一种是类级别的插件开发,即给
jQuery添加新的全局函数,相当于给
jQuery类本身添加方法。
jQuery的全局函数就是属于
jQuery命名空间的函数,另一种是对象级别的插件开发,即给
jQuery对象添加方法。下面就两种函数的开发做详细的说明。
1
、类级别的插件开发 类级别的插件开发最直接的理解就是给jQuer
- Rome解析Rss
413277409
Rome解析Rss
import java.net.URL;
import java.util.List;
import org.junit.Test;
import com.sun.syndication.feed.synd.SyndCategory;
import com.sun.syndication.feed.synd.S
- RSA加密解密
无量
加密解密rsa
RSA加密解密代码
代码有待整理
package com.tongbanjie.commons.util;
import java.security.Key;
import java.security.KeyFactory;
import java.security.KeyPair;
import java.security.KeyPairGenerat
- linux 软件安装遇到的问题
aichenglong
linux遇到的问题ftp
1 ftp配置中遇到的问题
500 OOPS: cannot change directory
出现该问题的原因:是SELinux安装机制的问题.只要disable SELinux就可以了
修改方法:1 修改/etc/selinux/config 中SELINUX=disabled
2 source /etc
- 面试心得
alafqq
面试
最近面试了好几家公司。记录下;
支付宝,面试我的人胖胖的,看着人挺好的;博彦外包的职位,面试失败;
阿里金融,面试官人也挺和善,只不过我让他吐血了。。。
由于印象比较深,记录下;
1,自我介绍
2,说下八种基本类型;(算上string。楼主才答了3种,哈哈,string其实不是基本类型,是引用类型)
3,什么是包装类,包装类的优点;
4,平时看过什么书?NND,什么书都没看过。。照样
- java的多态性探讨
百合不是茶
java
java的多态性是指main方法在调用属性的时候类可以对这一属性做出反应的情况
//package 1;
class A{
public void test(){
System.out.println("A");
}
}
class D extends A{
public void test(){
S
- 网络编程基础篇之JavaScript-学习笔记
bijian1013
JavaScript
1.documentWrite
<html>
<head>
<script language="JavaScript">
document.write("这是电脑网络学校");
document.close();
</script>
</h
- 探索JUnit4扩展:深入Rule
bijian1013
JUnitRule单元测试
本文将进一步探究Rule的应用,展示如何使用Rule来替代@BeforeClass,@AfterClass,@Before和@After的功能。
在上一篇中提到,可以使用Rule替代现有的大部分Runner扩展,而且也不提倡对Runner中的withBefores(),withAfte
- [CSS]CSS浮动十五条规则
bit1129
css
这些浮动规则,主要是参考CSS权威指南关于浮动规则的总结,然后添加一些简单的例子以验证和理解这些规则。
1. 所有的页面元素都可以浮动 2. 一个元素浮动后,会成为块级元素,比如<span>,a, strong等都会变成块级元素 3.一个元素左浮动,会向最近的块级父元素的左上角移动,直到浮动元素的左外边界碰到块级父元素的左内边界;如果这个块级父元素已经有浮动元素停靠了
- 【Kafka六】Kafka Producer和Consumer多Broker、多Partition场景
bit1129
partition
0.Kafka服务器配置
3个broker
1个topic,6个partition,副本因子是2
2个consumer,每个consumer三个线程并发读取
1. Producer
package kafka.examples.multibrokers.producers;
import java.util.Properties;
import java.util.
- zabbix_agentd.conf配置文件详解
ronin47
zabbix 配置文件
Aliaskey的别名,例如 Alias=ttlsa.userid:vfs.file.regexp[/etc/passwd,^ttlsa:.:([0-9]+),,,,\1], 或者ttlsa的用户ID。你可以使用key:vfs.file.regexp[/etc/passwd,^ttlsa:.: ([0-9]+),,,,\1],也可以使用ttlsa.userid。备注: 别名不能重复,但是可以有多个
- java--19.用矩阵求Fibonacci数列的第N项
bylijinnan
fibonacci
参考了网上的思路,写了个Java版的:
public class Fibonacci {
final static int[] A={1,1,1,0};
public static void main(String[] args) {
int n=7;
for(int i=0;i<=n;i++){
int f=fibonac
- Netty源码学习-LengthFieldBasedFrameDecoder
bylijinnan
javanetty
先看看LengthFieldBasedFrameDecoder的官方API
http://docs.jboss.org/netty/3.1/api/org/jboss/netty/handler/codec/frame/LengthFieldBasedFrameDecoder.html
API举例说明了LengthFieldBasedFrameDecoder的解析机制,如下:
实
- AES加密解密
chicony
加密解密
AES加解密算法,使用Base64做转码以及辅助加密:
package com.wintv.common;
import javax.crypto.Cipher;
import javax.crypto.spec.IvParameterSpec;
import javax.crypto.spec.SecretKeySpec;
import sun.misc.BASE64Decod
- 文件编码格式转换
ctrain
编码格式
package com.test;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
- mysql 在linux客户端插入数据中文乱码
daizj
mysql中文乱码
1、查看系统客户端,数据库,连接层的编码
查看方法: http://daizj.iteye.com/blog/2174993
进入mysql,通过如下命令查看数据库编码方式: mysql> show variables like 'character_set_%'; +--------------------------+------
- 好代码是廉价的代码
dcj3sjt126com
程序员读书
长久以来我一直主张:好代码是廉价的代码。
当我跟做开发的同事说出这话时,他们的第一反应是一种惊愕,然后是将近一个星期的嘲笑,把它当作一个笑话来讲。 当他们走近看我的表情、知道我是认真的时,才收敛一点。
当最初的惊愕消退后,他们会用一些这样的话来反驳: “好代码不廉价,好代码是采用经过数十年计算机科学研究和积累得出的最佳实践设计模式和方法论建立起来的精心制作的程序代码。”
我只
- Android网络请求库——android-async-http
dcj3sjt126com
android
在iOS开发中有大名鼎鼎的ASIHttpRequest库,用来处理网络请求操作,今天要介绍的是一个在Android上同样强大的网络请求库android-async-http,目前非常火的应用Instagram和Pinterest的Android版就是用的这个网络请求库。这个网络请求库是基于Apache HttpClient库之上的一个异步网络请求处理库,网络处理均基于Android的非UI线程,通
- ORACLE 复习笔记之SQL语句的优化
eksliang
SQL优化Oracle sql语句优化SQL语句的优化
转载请出自出处:http://eksliang.iteye.com/blog/2097999
SQL语句的优化总结如下
sql语句的优化可以按照如下六个步骤进行:
合理使用索引
避免或者简化排序
消除对大表的扫描
避免复杂的通配符匹配
调整子查询的性能
EXISTS和IN运算符
下面我就按照上面这六个步骤分别进行总结:
- 浅析:Android 嵌套滑动机制(NestedScrolling)
gg163
android移动开发滑动机制嵌套
谷歌在发布安卓 Lollipop版本之后,为了更好的用户体验,Google为Android的滑动机制提供了NestedScrolling特性
NestedScrolling的特性可以体现在哪里呢?<!--[if !supportLineBreakNewLine]--><!--[endif]-->
比如你使用了Toolbar,下面一个ScrollView,向上滚
- 使用hovertree菜单作为后台导航
hvt
JavaScriptjquery.nethovertreeasp.net
hovertree是一个jquery菜单插件,官方网址:http://keleyi.com/jq/hovertree/ ,可以登录该网址体验效果。
0.1.3版本:http://keleyi.com/jq/hovertree/demo/demo.0.1.3.htm
hovertree插件包含文件:
http://keleyi.com/jq/hovertree/css
- SVG 教程 (二)矩形
天梯梦
svg
SVG <rect> SVG Shapes
SVG有一些预定义的形状元素,可被开发者使用和操作:
矩形 <rect>
圆形 <circle>
椭圆 <ellipse>
线 <line>
折线 <polyline>
多边形 <polygon>
路径 <path>
- 一个简单的队列
luyulong
java数据结构队列
public class MyQueue {
private long[] arr;
private int front;
private int end;
// 有效数据的大小
private int elements;
public MyQueue() {
arr = new long[10];
elements = 0;
front
- 基础数据结构和算法九:Binary Search Tree
sunwinner
Algorithm
A binary search tree (BST) is a binary tree where each node has a Comparable key (and an associated value) and satisfies the restriction that the key in any node is larger than the keys in all
- 项目出现的一些问题和体会
Steven-Walker
DAOWebservlet
第一篇博客不知道要写点什么,就先来点近阶段的感悟吧。
这几天学了servlet和数据库等知识,就参照老方的视频写了一个简单的增删改查的,完成了最简单的一些功能,使用了三层架构。
dao层完成的是对数据库具体的功能实现,service层调用了dao层的实现方法,具体对servlet提供支持。
&
- 高手问答:Java老A带你全面提升Java单兵作战能力!
ITeye管理员
java
本期特邀《Java特种兵》作者:谢宇,CSDN论坛ID: xieyuooo 针对JAVA问题给予大家解答,欢迎网友积极提问,与专家一起讨论!
作者简介:
淘宝网资深Java工程师,CSDN超人气博主,人称“胖哥”。
CSDN博客地址:
http://blog.csdn.net/xieyuooo
作者在进入大学前是一个不折不扣的计算机白痴,曾经被人笑话过不懂鼠标是什么,