- struts处理中文乱码问题总结(转帖)
pcjavanet
struts2
在进行struts开发的过程中,总也是出现很多的乱码问题,但归根到底,也只是以下三种情况:㈠页面显示中文乱码㈡传递参数中文乱码㈢国际化资源文件乱码下面就这三中情况介绍怎么在具体项目中处理这些乱码问题。而对于整体的处理思想,是要统一编码为:UTF-8.(以myeclipse6支持的struts1.3为准)㈠页面显示中文乱码对于在页面中显示出现乱码,这个问题比较简单,便是检查你的JSP文件里是不是出现
- struts文件上传中文乱码的解决
liubinslt1
用struts1.3做文件上传(用的是struts自带的org.apache.struts.upload.FormFile实现文件的上传)的时候出现乱码的问题,即提交了包含file类型的input的页面(页面的编码为UTF-8)后,在action中取出参数时出了问题,具体的表现是页面提交的参数中参数值为中文的时候,在action中获得的参数值为乱码,如当上传的文件的文件名为中文时,在action中
- struts1.3 上传下载 文件名乱码
iteye_6331
struts
吸收了很多网上的方案,发现掺合起来才好使。。。。1.上传form传参a要使用过滤器utf-8b页面设置成utf-8c使用struts1.1以上版本2.下载url传参,过滤器居然不好用。把tomcatserver.xmlURIEncode设成utf-8传进来的参数终于不是乱码了。但是下载时的名字还是乱码。又在网上查了好多方法URLEncode啥的都不好用开始设成Stringname=newStrin
- SSH整合开发解决中文乱码的两种方式
离别灬逝去
Spring
1.使用spring解决struts1.3乱码问题。直接可以在web.xml中添加Spring提供的CharacterEncodingFilter过滤器进行过滤encodingorg.springframework.web.filter.CharacterEncodingFilterencodingUTF-8encoding/*2.自己写一个过滤器在后台处理前更改编码arg0.setCharact
- struts1.3源码学习
daryanny
J2EEstrutsactionnullbeanhashmapservlet
最近在看struts1.3源码,做个记录执行流程:1、ActionServlet处理.do的请求不管是get还是post方式都将转到protectedvoidprocess(HttpServletRequestrequest,HttpServletResponseresponse)方法。2、根据请求对象和servletContext对象选择请求所隶属的模块ModuleUtils.getInstan
- struts1的配置
玲珑花
工具:Myeclipse项目右键--Myeclipse--addStruts此次选择为struts1.3,其余为默认,确定即可完成。可以查看web.xml,已经自动配置好struts的servlet,struts-config文件已经生成。我的web.xml文件配置actionorg.apache.struts.action.ActionServletconfig/WEB-INF/struts-c
- Java线程(六):线程池
yuhushangwei
java线程池
自JDK5之后,Java推出了一个并发包,java.util.concurrent,在Java开发中,我们接触到了好多池的技术,String类的对象池、Integer的共享池、连接数据库的连接池、Struts1.3的对象池等等,池的最终目的都是节约资源,以更小的开销做更多的事情,从而提高性能。 我们的web项目都是部署在服务器上,浏览器端的每一个request就是一个线程,那么服务器
- Struts1.3——文件上传和下载
ggGavin
文件上传strutsweb开发
1.Struts文件上传在Web开发中,会经常涉及到文件的上传和下载,比如在注册账户的时候,我们需要上传自己的头像等。我们可以利用Struts很方便地实现文件的上传。1.1开发步骤现在,假设我们要在注册的时候上传自己的头像。新建项目名称为StrutsFileUpAndDown,并引入Struts1.3(1)首先,写注册的JSP页面register.jsp它的body内容如下:
注册用户
名字:
- Struts1.3——DispatchAction、DynamicForm和全局跳转
ggGavin
框架struts
1.DispatchAction-分派Action1.1为什么需要DispatchAction如果每个请求都对应一个Action,就会造成action过多,程序显得比较臃肿,所以可以把一类请求写到一个action中处理,即DispatchAction在没有使用框架之前,当我们通过一个控制器处理多个请求的时候,我们是通过在URL后面跟上参数来区别不同的操作,比如,下述链接:http://localh
- Struts1.3——Struts标签
ggGavin
struts标签
1.struts标签的介绍Struts框架提供了一组非常丰富的框架组件,同时也提供了一组标签库用于和这些组件交互,主要介绍以下三类:html标签bean标签logic标签2.Html标签库struts标签库中包括很多标签,其中html标签是最常用的标签之一,该标签库包含的标签可以用来创建Struts输入表单和用户界面。这类标签实际上就是普通的html标签,Struts设计者主要是为了和Struts
- Struts1.3——使用MyEclipse集成工具开发Struts
ggGavin
strutsMyEclipse
前面两篇通过手工写代码,手工配置struts-config.xml文件的方法来开发了一个最简单的struts项目,通过手工的方式旨在学习底层原理细节。当熟悉了以后,我们就不需要再通过纯手工的方式来开发struts了,MyEclipse为我们提供了便捷的集成开发工具。下面就介绍通过MyEclipse自动开发struts的步骤。这里仍然使用登录验证系统来说明。1.建立web工程首先要建立web工程,这
- Struts1.3——登录案例的改进
ggGavin
struts
在上篇写的用户登录验证案例的基础上进一步改进。1.在登录成功后的welcome.jsp页面显示登录成功的用户名思路1:在LoginAction中,将username放入request的域对象中因为,ActionMapping的findForward()方法实质上是请求转发,所以可以把username放入request的域对象中,如下:publicclassLoginActionextendsAct
- Struts1.3——Struts入门
KLeonard
☛JavaWebJavaWeb框架
1.Struts的几个基本概念1.struts是一个开源框架(frameset)2.struts是一个Web框架3.struts是一个基于MVC的Web框架2.为什么有struts因为我们对MVC的理解不同,可能造成不同公司写程序的时候,规范不统一,这样不利于程序的维护和扩展以及提高开发效率,所以我们有必要用一个统一的规范来开发项目。所以出现了struts.struts是通过采用Java的Serv
- Struts1.3——Struts入门
ggGavin
mvcstrutsweb框架
1.Struts的几个基本概念1.struts是一个开源框架(frameset)2.struts是一个Web框架3.struts是一个基于MVC的Web框架2.为什么有struts因为我们对MVC的理解不同,可能造成不同公司写程序的时候,规范不统一,这样不利于程序的维护和扩展以及提高开发效率,所以我们有必要用一个统一的规范来开发项目。所以出现了struts.struts是通过采用Java的Serv
- 个人博客系统--项目实战
Switchvov
JavaEE
个人博客系统–项目实战先附上设计文档和项目源码。个人博客设计文档Github这项目大概做了十多天,其基本功能都实现了,因为没有美工的关系,界面可能有点丑,请谅解。后台采用SSH技术,版本为:Struts1.3、Spring2.5和Hibernate3.3。可能版本有些老,但并不影响使用和扩展。后台分层采用的是MVC结构,其具体分层方案,可以参考SpringMVC实战-雇员薪资管理系统这篇博客。前台
- 个人博客系统--项目实战
q547550831
githubspringHibernatemvcstruts
个人博客系统–项目实战先附上设计文档和项目源码。个人博客设计文档Github这项目大概做了十多天,其基本功能都实现了,因为没有美工的关系,界面可能有点丑,请谅解。后台采用SSH技术,版本为:Struts1.3、Spring2.5和Hibernate3.3。可能版本有些老,但并不影响使用和扩展。后台分层采用的是MVC结构,其具体分层方案,可以参考SpringMVC实战-雇员薪资管理系统这篇博客。前台
- java ssh整合出的错java.lang.NoSuchMethodError: antlr.collections.AST.getLine()
mashihao123
java
**有可能是你的jar版本问题吧,因为Struts自带的antlr-2.7.2.jar,比Hibernate3.3自带的antlr-2.7.6.jar的版本要低,故要删除前一个低版本的,,struts1.3和2.1都带有antlr-2.7.2.jar,,,下面我要把它们都清除了,,由于myeclipse添加的struts性能不是放在工程lib下的,而是myeclipse自带的,,所以删除比较麻烦,
- java ssh整合出的错java.lang.NoSuchMethodError: antlr.collections.AST.getLine()
mashihao123
有可能是你的jar版本问题吧,
因为Struts自带的antlr-2.7.2.jar,比Hibernate3.3自带的antlr-2.7.7.jar的版本要低,故要删除前一个低版本的,,struts1.3和2.1都带有antlr-2.7.2.jar,,,下面我要把它们都清除了,,
由于myeclipse添加的struts性能不是放在工程lib下的,而是myeclipse自带的,,所以删除比较麻烦,
- Java线程篇(六):线程池
z742182637
java线程池
自JDK5之后,Java推出了一个并发包,java.util.concurrent,在Java开发中,我们接触到了好多池的技术,String类的对象池、Integer的共享池、连接数据库的连接池、Struts1.3的对象池等等,池的最终目的都是节约资源,以更小的开销做更多的事情,从而提高性能。 我们的web项目都是部署在服务器上,浏览器端的每一个request就是一个线程,那么服务器需要并发
- Spring3-hibernate3.3-struts2.1.8----环境搭建(1)
hibernate3
当前Myeclipse8.6已经集成了最新的Spring, hibernate, struts。 通过Myeclipse可以简化SSH开发,能自动生成注解的POJO数据库映射类。但是也存在一些问题。
一些Jar冲突
myeclipse8.6 还不支持生成struts2.1.6以上的Struts的元素Action,jsp (struts1.3支持这些元素的自动生成)
&
- 上传excel数据到数据库中遇到问题(struts1.3)—修正版
Struts1.3
(1)日期问题
从单元格中取得的日期与数据库中日期无法匹配,由于单元格中取得的日期默认形式为“Mon Mar 18 16:53:27 CST 2013”,我们要先把其格式化为想要格式的日期字符串,如“yyyy-mm-dd”,然后用java.sql.Date的valueOf( )方法取得该日期字符串对应于数据库中的日期。
1 java.util.Date date=cell.getDateCe
- 小案例:struts1.3利用nested标签使用POJO
Struts1.3
其中的关键就是这个POJO是你自己去new一个,struts是不会帮你创建的!参考http://luohua.iteye.com/blog/39976
表单页
<%@ page language="java" contentType="text/html; charset=GBK"
pageEncoding="GBK"
- [已修正]安装struts找不到tld文件
struts
今天安装的struts1.3,但是缺少tld文件,所以无法使用taglib,找了半天
假设你的struts版本为1.3.10
解压后的目录为F:\struts-1.3.10-all\struts-1.3.10\[apps,docs,lib,src,LICENSE.txt,NOTICE.txt]
那么你找到F:\struts-1.3.10-all\struts-1.3.10\lib\strut
- struts1.3设置编码三种方法
Struts1.3
本文所写涉及的struts的版本是1.3x.
一、改写struts的ActionServlet. 重写process()方法:
Java代码
package com.soft.struts.action;
import javax.servlet.http.HttpServletRequest;
impo
- NoSuchMethodError: antlr.collections.AST.getLine()I
Collections
错误完整表述:
Filter execution threw an exception] with root cause java.lang.NoSuchMethodError: antlr.collections.AST.getLine()I
在谷哥,度娘上问了,他们给出居多无比的文章,并且答案很一致:因为struts2(或者Struts1.3)中的antlr-2.7.2和hibernate
- struts1.3执行流程分析
Struts1.3
这是在去年9月份,读了一下struts1.3的源码,记录了一下执行流程。发出来和大家分享一下吧。这个流程还是很经典的吧。有空再读读struts2的^_^
执行流程:1、ActionServlet处理.do的请求 不管是get还是post方式都将转到
protected void process(HttpServletRequest request,
- 移植策略
移植策略
Struts1開發者向Struts2的移植策略包含四個非獨家的方式:
1. 雙信息處理器(Dual processor),共享資源-將Struts2.0的JAR包添加到Struts1.3應用程序中。配置S2麳控制*.action請求s和讓S1控制*.do請求。S1和S2可以一塊運行,同在一個web應用程序中。團隊可以實現新特性在最終版本中,移植所需老版本的一部分。隨意的
- Java线程(4)线程池
buster2014
文章来源:http://blog.sina.com.cn/s/blog_6560efc9010185el.html自JDK5之后,Java推出了一个并发包,java.util.concurrent,在Java开发中,我们接触到了好多池的技术,String类的对象池、Integer的共享池、连接数据库的连接池、Struts1.3的对象池等等,池的最终目的都是节约资源,以更小的开销做更多的事情,从而提
- Struts1.3 学习笔记
CuckooLong
action跳转页面出现空白页解:重写execute方法时,选择参数带HttpServletRequest、HttpServletResponse的方法。
- 解决Struts中文乱码问题总结
xiaole0313
struts
在进行struts开发的过程中,总也是出现很多的乱码问题,但归根到底,也只是以下三种情况: ㈠页面显示中文乱码 ㈡传递参数中文乱码 ㈢国际化资源文件乱码 下面就这三中情况介绍怎么在具体项目中处理这些乱码问题。而对于整体的处理思想,是要统一编码为:UTF-8.(以myeclipse6支持的struts1.3为准) ㈠页面显示中文乱码 对于在页面中显示出现乱码,这个问题比较简单,便是检查你
- Js函数返回值
_wy_
jsreturn
一、返回控制与函数结果,语法为:return 表达式;作用: 结束函数执行,返回调用函数,而且把表达式的值作为函数的结果 二、返回控制语法为:return;作用: 结束函数执行,返回调用函数,而且把undefined作为函数的结果 在大多数情况下,为事件处理函数返回false,可以防止默认的事件行为.例如,默认情况下点击一个<a>元素,页面会跳转到该元素href属性
- MySQL 的 char 与 varchar
bylijinnan
mysql
今天发现,create table 时,MySQL 4.1有时会把 char 自动转换成 varchar
测试举例:
CREATE TABLE `varcharLessThan4` (
`lastName` varchar(3)
) ;
mysql> desc varcharLessThan4;
+----------+---------+------+-
- Quartz——TriggerListener和JobListener
eksliang
TriggerListenerJobListenerquartz
转载请出自出处:http://eksliang.iteye.com/blog/2208624 一.概述
listener是一个监听器对象,用于监听scheduler中发生的事件,然后执行相应的操作;你可能已经猜到了,TriggerListeners接受与trigger相关的事件,JobListeners接受与jobs相关的事件。
二.JobListener监听器
j
- oracle层次查询
18289753290
oracle;层次查询;树查询
.oracle层次查询(connect by)
oracle的emp表中包含了一列mgr指出谁是雇员的经理,由于经理也是雇员,所以经理的信息也存储在emp表中。这样emp表就是一个自引用表,表中的mgr列是一个自引用列,它指向emp表中的empno列,mgr表示一个员工的管理者,
select empno,mgr,ename,sal from e
- 通过反射把map中的属性赋值到实体类bean对象中
酷的飞上天空
javaee泛型类型转换
使用过struts2后感觉最方便的就是这个框架能自动把表单的参数赋值到action里面的对象中
但现在主要使用Spring框架的MVC,虽然也有@ModelAttribute可以使用但是明显感觉不方便。
好吧,那就自己再造一个轮子吧。
原理都知道,就是利用反射进行字段的赋值,下面贴代码
主要类如下:
import java.lang.reflect.Field;
imp
- SAP HANA数据存储:传统硬盘的瓶颈问题
蓝儿唯美
HANA
SAPHANA平台有各种各样的应用场景,这也意味着客户的实施方法有许多种选择,关键是如何挑选最适合他们需求的实施方案。
在 《Implementing SAP HANA》这本书中,介绍了SAP平台在现实场景中的运作原理,并给出了实施建议和成功案例供参考。本系列文章节选自《Implementing SAP HANA》,介绍了行存储和列存储的各自特点,以及SAP HANA的数据存储方式如何提升空间压
- Java Socket 多线程实现文件传输
随便小屋
javasocket
高级操作系统作业,让用Socket实现文件传输,有些代码也是在网上找的,写的不好,如果大家能用就用上。
客户端类:
package edu.logic.client;
import java.io.BufferedInputStream;
import java.io.Buffered
- java初学者路径
aijuans
java
学习Java有没有什么捷径?要想学好Java,首先要知道Java的大致分类。自从Sun推出Java以来,就力图使之无所不包,所以Java发展到现在,按应用来分主要分为三大块:J2SE,J2ME和J2EE,这也就是Sun ONE(Open Net Environment)体系。J2SE就是Java2的标准版,主要用于桌面应用软件的编程;J2ME主要应用于嵌入是系统开发,如手机和PDA的编程;J2EE
- APP推广
aoyouzi
APP推广
一,免费篇
1,APP推荐类网站自主推荐
最美应用、酷安网、DEMO8、木蚂蚁发现频道等,如果产品独特新颖,还能获取最美应用的评测推荐。PS:推荐简单。只要产品有趣好玩,用户会自主分享传播。例如足迹APP在最美应用推荐一次,几天用户暴增将服务器击垮。
2,各大应用商店首发合作
老实盯着排期,多给应用市场官方负责人献殷勤。
3,论坛贴吧推广
百度知道,百度贴吧,猫扑论坛,天涯社区,豆瓣(
- JSP转发与重定向
百合不是茶
jspservletJava Webjsp转发
在servlet和jsp中我们经常需要请求,这时就需要用到转发和重定向;
转发包括;forward和include
例子;forwrad转发; 将请求装法给reg.html页面
关键代码;
req.getRequestDispatcher("reg.html
- web.xml之jsp-config
bijian1013
javaweb.xmlservletjsp-config
1.作用:主要用于设定JSP页面的相关配置。
2.常见定义:
<jsp-config>
<taglib>
<taglib-uri>URI(定义TLD文件的URI,JSP页面的tablib命令可以经由此URI获取到TLD文件)</tablib-uri>
<taglib-location>
TLD文件所在的位置
- JSF2.2 ViewScoped Using CDI
sunjing
CDIJSF 2.2ViewScoped
JSF 2.0 introduced annotation @ViewScoped; A bean annotated with this scope maintained its state as long as the user stays on the same view(reloads or navigation - no intervening views). One problem w
- 【分布式数据一致性二】Zookeeper数据读写一致性
bit1129
zookeeper
很多文档说Zookeeper是强一致性保证,事实不然。关于一致性模型请参考http://bit1129.iteye.com/blog/2155336
Zookeeper的数据同步协议
Zookeeper采用称为Quorum Based Protocol的数据同步协议。假如Zookeeper集群有N台Zookeeper服务器(N通常取奇数,3台能够满足数据可靠性同时
- Java开发笔记
白糖_
java开发
1、Map<key,value>的remove方法只能识别相同类型的key值
Map<Integer,String> map = new HashMap<Integer,String>();
map.put(1,"a");
map.put(2,"b");
map.put(3,"c"
- 图片黑色阴影
bozch
图片
.event{ padding:0; width:460px; min-width: 460px; border:0px solid #e4e4e4; height: 350px; min-heig
- 编程之美-饮料供货-动态规划
bylijinnan
动态规划
import java.util.Arrays;
import java.util.Random;
public class BeverageSupply {
/**
* 编程之美 饮料供货
* 设Opt(V’,i)表示从i到n-1种饮料中,总容量为V’的方案中,满意度之和的最大值。
* 那么递归式就应该是:Opt(V’,i)=max{ k * Hi+Op
- ajax大参数(大数据)提交性能分析
chenbowen00
WebAjax框架浏览器prototype
近期在项目中发现如下一个问题
项目中有个提交现场事件的功能,该功能主要是在web客户端保存现场数据(主要有截屏,终端日志等信息)然后提交到服务器上方便我们分析定位问题。客户在使用该功能的过程中反应点击提交后反应很慢,大概要等10到20秒的时间浏览器才能操作,期间页面不响应事件。
根据客户描述分析了下的代码流程,很简单,主要通过OCX控件截屏,在将前端的日志等文件使用OCX控件打包,在将之转换为
- [宇宙与天文]在太空采矿,在太空建造
comsci
我们在太空进行工业活动...但是不太可能把太空工业产品又运回到地面上进行加工,而一般是在哪里开采,就在哪里加工,太空的微重力环境,可能会使我们的工业产品的制造尺度非常巨大....
地球上制造的最大工业机器是超级油轮和航空母舰,再大些就会遇到困难了,但是在空间船坞中,制造的最大工业机器,可能就没
- ORACLE中CONSTRAINT的四对属性
daizj
oracleCONSTRAINT
ORACLE中CONSTRAINT的四对属性
summary:在data migrate时,某些表的约束总是困扰着我们,让我们的migratet举步维艰,如何利用约束本身的属性来处理这些问题呢?本文详细介绍了约束的四对属性: Deferrable/not deferrable, Deferred/immediate, enalbe/disable, validate/novalidate,以及如
- Gradle入门教程
dengkane
gradle
一、寻找gradle的历程
一开始的时候,我们只有一个工程,所有要用到的jar包都放到工程目录下面,时间长了,工程越来越大,使用到的jar包也越来越多,难以理解jar之间的依赖关系。再后来我们把旧的工程拆分到不同的工程里,靠ide来管理工程之间的依赖关系,各工程下的jar包依赖是杂乱的。一段时间后,我们发现用ide来管理项程很不方便,比如不方便脱离ide自动构建,于是我们写自己的ant脚本。再后
- C语言简单循环示例
dcj3sjt126com
c
# include <stdio.h>
int main(void)
{
int i;
int count = 0;
int sum = 0;
float avg;
for (i=1; i<=100; i++)
{
if (i%2==0)
{
count++;
sum += i;
}
}
avg
- presentModalViewController 的动画效果
dcj3sjt126com
controller
系统自带(四种效果):
presentModalViewController模态的动画效果设置:
[cpp]
view plain
copy
UIViewController *detailViewController = [[UIViewController al
- java 二分查找
shuizhaosi888
二分查找java二分查找
需求:在排好顺序的一串数字中,找到数字T
一般解法:从左到右扫描数据,其运行花费线性时间O(N)。然而这个算法并没有用到该表已经排序的事实。
/**
*
* @param array
* 顺序数组
* @param t
* 要查找对象
* @return
*/
public stati
- Spring Security(07)——缓存UserDetails
234390216
ehcache缓存Spring Security
Spring Security提供了一个实现了可以缓存UserDetails的UserDetailsService实现类,CachingUserDetailsService。该类的构造接收一个用于真正加载UserDetails的UserDetailsService实现类。当需要加载UserDetails时,其首先会从缓存中获取,如果缓存中没
- Dozer 深层次复制
jayluns
VOmavenpo
最近在做项目上遇到了一些小问题,因为架构在做设计的时候web前段展示用到了vo层,而在后台进行与数据库层操作的时候用到的是Po层。这样在业务层返回vo到控制层,每一次都需要从po-->转化到vo层,用到BeanUtils.copyProperties(source, target)只能复制简单的属性,因为实体类都配置了hibernate那些关联关系,所以它满足不了现在的需求,但后发现还有个很
- CSS规范整理(摘自懒人图库)
a409435341
htmlUIcss浏览器
刚没事闲着在网上瞎逛,找了一篇CSS规范整理,粗略看了一下后还蛮有一定的道理,并自问是否有这样的规范,这也是初入前端开发的人一个很好的规范吧。
一、文件规范
1、文件均归档至约定的目录中。
具体要求通过豆瓣的CSS规范进行讲解:
所有的CSS分为两大类:通用类和业务类。通用的CSS文件,放在如下目录中:
基本样式库 /css/core
- C++动态链接库创建与使用
你不认识的休道人
C++dll
一、创建动态链接库
1.新建工程test中选择”MFC [dll]”dll类型选择第二项"Regular DLL With MFC shared linked",完成
2.在test.h中添加
extern “C” 返回类型 _declspec(dllexport)函数名(参数列表);
3.在test.cpp中最后写
extern “C” 返回类型 _decls
- Android代码混淆之ProGuard
rensanning
ProGuard
Android应用的Java代码,通过反编译apk文件(dex2jar、apktool)很容易得到源代码,所以在release版本的apk中一定要混淆一下一些关键的Java源码。
ProGuard是一个开源的Java代码混淆器(obfuscation)。ADT r8开始它被默认集成到了Android SDK中。
官网:
http://proguard.sourceforge.net/
- 程序员在编程中遇到的奇葩弱智问题
tomcat_oracle
jquery编程ide
现在收集一下:
排名不分先后,按照发言顺序来的。
1、Jquery插件一个通用函数一直报错,尤其是很明显是存在的函数,很有可能就是你没有引入jquery。。。或者版本不对
2、调试半天没变化:不在同一个文件中调试。这个很可怕,我们很多时候会备份好几个项目,改完发现改错了。有个群友说的好: 在汤匙
- 解决maven-dependency-plugin (goals "copy-dependencies","unpack") is not supported
xp9802
dependency
解决办法:在plugins之前添加如下pluginManagement,二者前后顺序如下:
[html]
view plain
copy
<build>
<pluginManagement