易截截图软件、单文件、免安装、纯绿色、仅160KB

java web开发中防止乱码的方法

1.在系统中导入一下source
SetCharacterEncodingFilter.java
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements.  See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License.  You may obtain a copy of the License at
*
*     http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import java.io.IOException;
import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.FilterConfig;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
//******************************************************
//システム名 販売システム
//機能名 日本語文字化け防止
//クラス名 SetCharacterEncodingFilter.java
//
//
//@author xiehl (Tomcatから転載)
//@version 2009.07.13 新規作成
//
//******************************************************
/**
 * <p>Example filter that sets the character encoding to be used in parsing the
 * incoming request, either unconditionally or only if the client did not
 * specify a character encoding.  Configuration of this filter is based on
 * the following initialization parameters:</p>
 * <ul>
 * <li><strong>encoding</strong> - The character encoding to be configured
 *     for this request, either conditionally or unconditi


相关文档:

java入门

 Java学习从入门到精通 
一、 JDK (Java Development Kit) 
JDK是整个Java的核心,包括了Java运行环境(Java Runtime Envirnment),一堆Java工具和Java基础的类库(rt.jar)。不论什么Java应用服务器实质都是内置了某个版本的JDK。因此掌握JDK是学好Java的第一步。最主流的J ......

java中 最常用的String 的用法

String : 字符串类型
一、构造函数
String(byte[ ] bytes):通过byte数组构造字符串对象。
String(char[ ] value):通过char数组构造字符串对象。
String(Sting original):构造一个original的副本。即:拷贝一个original。
String(StringBuffer buffer):通过StringBuffer数组构造字符串对象。
例如:
byte[] b = ......

Java HashMap和TreeMap的排序问题总结

Map存储的是key->value的值对,key的值是唯一的,而value的值可以重复。通常使用的是HashMap或TreeMap,如果考虑性能,使用HashMap。TreeMap使用红黑树实现,保留有key值顺序性,会自动按照key值排序。
默认是按照key值的升序排序,key值必须实现 Comparator接口。如果希望按找一定规则排序,则需要重新定义compare函数 ......

java中float/double浮点数的计算失精度问题

 java中浮点数的计算
今天在数值计算时碰到一个问题.程序如下:
  double a = (3.3-2.4)/0.1;
  System.out.println(a);
你可能认为结果很简单,不就是9嘛,是事实上,结果为:8.999999998,为什么呢?我翻阅了一些资料,终于找出了原因.
为什么浮点数会丢失精度? 
十进制数的二进制表示可能不够精确
......

java学习笔记(1)

     登录验证,当用户名为abc,密码为123时返回通过,否则为登录失败,若只输入了其中一项,则返回参数不正确。
代码如下:
   
//登录验证范例 ——一个标准的程序设计模式
class Login
{    
       private S ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号