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.
......
1£º³¬Á¬½ÓÌø×ª
ÎÒÃÇÔÚ³¬Á¬½ÓµÄʱºò£¬³£³£Á¬½Óµ½Ò»¸öjsp»òÕßAction,±ÈÈç:
XXX
ÕâÑù×ö»áÓÐÒ»¸öÎÊÌ⣺ÔÚtest.jspÖУ¬³ýÄã´«µÝµÄparam1ºÍparam2²ÎÊýÍâ,ÄãÓÃrequest.getParamter()È¡ÈκÎÔÀ´Ò³ÃæµÄ±íµ¥ÔªËض¼»áΪ¿Õ£¬ÕâÊÇÒòΪÕâÖÖ·½Ê½»á²úÉúеÄrequestÉúÃüÖÜÆÚ£¬ÔÚÕâ¸örequestÖÐÖ»»á°üº¬³¬Á¬½Óºó¸úËæµÄ?param1ÕâÖÖ²ÎÊý£¬ Òò´ ......
1¡¢ ×î»ù±¾µÄÂÒÂëÎÊÌâ¡£
Õâ¸öÂÒÂëÎÊÌâÊÇ×î¼òµ¥µÄÂÒÂëÎÊÌâ¡£Ò»°ãлá³öÏÖ¡£¾ÍÊÇÒ³Ãæ±àÂë²»Ò»Öµ¼ÖµÄÂÒÂë¡£
<%@ page language="java" pageEncoding="UTF-8"%>
<%@ page contentType="text/html;charset=iso8859-1"%>
<html>
<head>
<title>ÖÐÎÄÎÊÌâ</title>
<meta http-equi ......
<project name="jspToServletToClass" default="jsp2servlet2class" basedir=".">
<!-- set global properties for this build -->
<property environment="env" />
<property name="src" location="F:\JspC\src\" />
< ......