SetCharacterEncodingFilter jsp字符过滤器
package com.demo.filter;
import javax.servlet.Filter;
import javax.servlet.FilterConfig;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.FilterChain;
import java.io.IOException;
public class SetCharacterEncodingFilter implements Filter {
protected FilterConfig filterConfig;
protected String encodingName;
protected boolean enable;
public SetCharacterEncodingFilter() {
this.encodingName = "GBK";
this.enable = false;
}
public void init(FilterConfig filterConfig) throws ServletException {
this.filterConfig = filterConfig;
}
public void doFilter(ServletRequest request,
ServletResponse response,
FilterChain chain)
throws IOException, ServletException {
request.setCharacterEncoding("GBK");
response.setCharacterEncoding("GBK");
chain.doFilter(request, response);
}
public void destroy() {
}
}
————————————————————————————————————————————
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.5" xsi:schemaLocation="http://java.sun.
相关文档:
java导入导出excel操作(jxl)(1)
关键字: java导入导出excel操作(jxl)(1)
jxl.jar 包
下载地址:
http://www.andykhan.com/jexcelapi/
真实下载地址:
http://www.andykhan.com/jexcelapi/download.html
网站上对它的特征有如下描述:
● 支持Excel 95-2000的所有版本
● 生成Excel 2000标准格式
● 支持字体、 ......
jsp中读取properties文件,并把值设到js变量中:
web_stderr.properties文件内容:
common.username.error.null = UserName can not be null.
common.username.error.invalid = UserName is invalid.
common.password.error.null = Password can not bu null.
common.password.error.invalid = Password is invalid.
......
Actio中传递参数
request.setAttribute("userName",fbName);
request.setAttribute("passWord",pwd);
request.setAttribute("CDNUrl",CDNUrl);
-------------------------------------------------------------------
AC_FL_RunContent(
'codebase', 'http://download.macromed ......
经常看到许多人问如何配置JDK和JSP,现在我把方法总结下,希望对大家有所帮助。
第一步:下载jdk和tomcat
第二步:安装和配置你的jdk和tomcat:执行jdk和tomcat的安装程序,然后设置按照路径进行安装即可。
1.安装j2sdk以后,需要配置一下环境变量,在我的电脑->属性->高级->环境变量->系统变量中添加以下环 ......
Impl
public class BaseDAOImpl extends HibernateDaoSupport implements IBaseDAO
//添加数据
this.getHibernateTemplate().save(achi);
//删除
this.getHibernateTemplate().delete(this.getById(achi));
//查询所有
return this.getHibernateTemplate().find("from Achievement a ......