- 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
- 矩阵求逆(JAVA)初等行变换
qiuwanchi
矩阵求逆(JAVA)
package gaodai.matrix;
import gaodai.determinant.DeterminantCalculation;
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
/**
* 矩阵求逆(初等行变换)
* @author 邱万迟
*
- JDK timer
antlove
javajdkschedulecodetimer
1.java.util.Timer.schedule(TimerTask task, long delay):多长时间(毫秒)后执行任务
2.java.util.Timer.schedule(TimerTask task, Date time):设定某个时间执行任务
3.java.util.Timer.schedule(TimerTask task, long delay,longperiod
- JVM调优总结 -Xms -Xmx -Xmn -Xss
coder_xpf
jvm应用服务器
堆大小设置JVM 中最大堆大小有三方面限制:相关操作系统的数据模型(32-bt还是64-bit)限制;系统的可用虚拟内存限制;系统的可用物理内存限制。32位系统下,一般限制在1.5G~2G;64为操作系统对内存无限制。我在Windows Server 2003 系统,3.5G物理内存,JDK5.0下测试,最大可设置为1478m。
典型设置:
java -Xmx
- JDBC连接数据库
Array_06
jdbc
package Util;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
public class JDBCUtil {
//完
- Unsupported major.minor version 51.0(jdk版本错误)
oloz
java
java.lang.UnsupportedClassVersionError: cn/support/cache/CacheType : Unsupported major.minor version 51.0 (unable to load class cn.support.cache.CacheType)
at org.apache.catalina.loader.WebappClassL
- 用多个线程处理1个List集合
362217990
多线程threadlist集合
昨天发了一个提问,启动5个线程将一个List中的内容,然后将5个线程的内容拼接起来,由于时间比较急迫,自己就写了一个Demo,希望对菜鸟有参考意义。。
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.CountDownLatch;
public c
- JSP简单访问数据库
香水浓
sqlmysqljsp
学习使用javaBean,代码很烂,仅为留个脚印
public class DBHelper {
private String driverName;
private String url;
private String user;
private String password;
private Connection connection;
privat
- Flex4中使用组件添加柱状图、饼状图等图表
AdyZhang
Flex
1.添加一个最简单的柱状图
? 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
<?xml version=
"1.0"&n
- Android 5.0 - ProgressBar 进度条无法展示到按钮的前面
aijuans
android
在低于SDK < 21 的版本中,ProgressBar 可以展示到按钮前面,并且为之在按钮的中间,但是切换到android 5.0后进度条ProgressBar 展示顺序变化了,按钮再前面,ProgressBar 在后面了我的xml配置文件如下:
[html]
view plain
copy
<RelativeLa
- 查询汇总的sql
baalwolf
sql
select list.listname, list.createtime,listcount from dream_list as list , (select listid,count(listid) as listcount from dream_list_user group by listid order by count(
- Linux du命令和df命令区别
BigBird2012
linux
1,两者区别
du,disk usage,是通过搜索文件来计算每个文件的大小然后累加,du能看到的文件只是一些当前存在的,没有被删除的。他计算的大小就是当前他认为存在的所有文件大小的累加和。
- AngularJS中的$apply,用还是不用?
bijian1013
JavaScriptAngularJS$apply
在AngularJS开发中,何时应该调用$scope.$apply(),何时不应该调用。下面我们透彻地解释这个问题。
但是首先,让我们把$apply转换成一种简化的形式。
scope.$apply就像一个懒惰的工人。它需要按照命
- [Zookeeper学习笔记十]Zookeeper源代码分析之ClientCnxn数据序列化和反序列化
bit1129
zookeeper
ClientCnxn是Zookeeper客户端和Zookeeper服务器端进行通信和事件通知处理的主要类,它内部包含两个类,1. SendThread 2. EventThread, SendThread负责客户端和服务器端的数据通信,也包括事件信息的传输,EventThread主要在客户端回调注册的Watchers进行通知处理
ClientCnxn构造方法
&
- 【Java命令一】jmap
bit1129
Java命令
jmap命令的用法:
[hadoop@hadoop sbin]$ jmap
Usage:
jmap [option] <pid>
(to connect to running process)
jmap [option] <executable <core>
(to connect to a
- Apache 服务器安全防护及实战
ronin47
此文转自IBM.
Apache 服务简介
Web 服务器也称为 WWW 服务器或 HTTP 服务器 (HTTP Server),它是 Internet 上最常见也是使用最频繁的服务器之一,Web 服务器能够为用户提供网页浏览、论坛访问等等服务。
由于用户在通过 Web 浏览器访问信息资源的过程中,无须再关心一些技术性的细节,而且界面非常友好,因而 Web 在 Internet 上一推出就得到
- unity 3d实例化位置出现布置?
brotherlamp
unity教程unityunity资料unity视频unity自学
问:unity 3d实例化位置出现布置?
答:实例化的同时就可以指定被实例化的物体的位置,即 position
Instantiate (original : Object, position : Vector3, rotation : Quaternion) : Object
这样你不需要再用Transform.Position了,
如果你省略了第二个参数(
- 《重构,改善现有代码的设计》第八章 Duplicate Observed Data
bylijinnan
java重构
import java.awt.Color;
import java.awt.Container;
import java.awt.FlowLayout;
import java.awt.Label;
import java.awt.TextField;
import java.awt.event.FocusAdapter;
import java.awt.event.FocusE
- struts2更改struts.xml配置目录
chiangfai
struts.xml
struts2默认是读取classes目录下的配置文件,要更改配置文件目录,比如放在WEB-INF下,路径应该写成../struts.xml(非/WEB-INF/struts.xml)
web.xml文件修改如下:
<filter>
<filter-name>struts2</filter-name>
<filter-class&g
- redis做缓存时的一点优化
chenchao051
redishadooppipeline
最近集群上有个job,其中需要短时间内频繁访问缓存,大概7亿多次。我这边的缓存是使用redis来做的,问题就来了。
首先,redis中存的是普通kv,没有考虑使用hash等解结构,那么以为着这个job需要访问7亿多次redis,导致效率低,且出现很多redi
- mysql导出数据不输出标题行
daizj
mysql数据导出去掉第一行去掉标题
当想使用数据库中的某些数据,想将其导入到文件中,而想去掉第一行的标题是可以加上-N参数
如通过下面命令导出数据:
mysql -uuserName -ppasswd -hhost -Pport -Ddatabase -e " select * from tableName" > exportResult.txt
结果为:
studentid
- phpexcel导出excel表简单入门示例
dcj3sjt126com
PHPExcelphpexcel
先下载PHPEXCEL类文件,放在class目录下面,然后新建一个index.php文件,内容如下
<?php
error_reporting(E_ALL);
ini_set('display_errors', TRUE);
ini_set('display_startup_errors', TRUE);
if (PHP_SAPI == 'cli')
die('
- 爱情格言
dcj3sjt126com
格言
1) I love you not because of who you are, but because of who I am when I am with you. 我爱你,不是因为你是一个怎样的人,而是因为我喜欢与你在一起时的感觉。 2) No man or woman is worth your tears, and the one who is, won‘t
- 转 Activity 详解——Activity文档翻译
e200702084
androidUIsqlite配置管理网络应用
activity 展现在用户面前的经常是全屏窗口,你也可以将 activity 作为浮动窗口来使用(使用设置了 windowIsFloating 的主题),或者嵌入到其他的 activity (使用 ActivityGroup )中。 当用户离开 activity 时你可以在 onPause() 进行相应的操作 。更重要的是,用户做的任何改变都应该在该点上提交 ( 经常提交到 ContentPro
- win7安装MongoDB服务
geeksun
mongodb
1. 下载MongoDB的windows版本:mongodb-win32-x86_64-2008plus-ssl-3.0.4.zip,Linux版本也在这里下载,下载地址: http://www.mongodb.org/downloads
2. 解压MongoDB在D:\server\mongodb, 在D:\server\mongodb下创建d
- Javascript魔法方法:__defineGetter__,__defineSetter__
hongtoushizi
js
转载自: http://www.blackglory.me/javascript-magic-method-definegetter-definesetter/
在javascript的类中,可以用defineGetter和defineSetter_控制成员变量的Get和Set行为
例如,在一个图书类中,我们自动为Book加上书名符号:
function Book(name){
- 错误的日期格式可能导致走nginx proxy cache时不能进行304响应
jinnianshilongnian
cache
昨天在整合某些系统的nginx配置时,出现了当使用nginx cache时无法返回304响应的情况,出问题的响应头: Content-Type:text/html; charset=gb2312 Date:Mon, 05 Jan 2015 01:58:05 GMT Expires:Mon , 05 Jan 15 02:03:00 GMT Last-Modified:Mon, 05
- 数据源架构模式之行数据入口
home198979
PHP架构行数据入口
注:看不懂的请勿踩,此文章非针对java,java爱好者可直接略过。
一、概念
行数据入口(Row Data Gateway):充当数据源中单条记录入口的对象,每行一个实例。
二、简单实现行数据入口
为了方便理解,还是先简单实现:
<?php
/**
* 行数据入口类
*/
class OrderGateway {
/*定义元数
- Linux各个目录的作用及内容
pda158
linux脚本
1)根目录“/” 根目录位于目录结构的最顶层,用斜线(/)表示,类似于
Windows
操作系统的“C:\“,包含Fedora操作系统中所有的目录和文件。 2)/bin /bin 目录又称为二进制目录,包含了那些供系统管理员和普通用户使用的重要
linux命令的二进制映像。该目录存放的内容包括各种可执行文件,还有某些可执行文件的符号连接。常用的命令有:cp、d
- ubuntu12.04上编译openjdk7
ol_beta
HotSpotjvmjdkOpenJDK
获取源码
从openjdk代码仓库获取(比较慢)
安装mercurial Mercurial是一个版本管理工具。 sudo apt-get install mercurial
将以下内容添加到$HOME/.hgrc文件中,如果没有则自己创建一个: [extensions] forest=/home/lichengwu/hgforest-crew/forest.py fe
- 将数据库字段转换成设计文档所需的字段
vipbooks
设计模式工作正则表达式
哈哈,出差这么久终于回来了,回家的感觉真好!
PowerDesigner的物理数据库一出来,设计文档中要改的字段就多得不计其数,如果要把PowerDesigner中的字段一个个Copy到设计文档中,那将会是一件非常痛苦的事情。