1
4

2 回答 2

1

您需要匹配完整的String使用String#matches

return input.matches(".*[" + CHARACTERS + "].*");

JSP 的 UTF-8 标头:

<%@ page language="java" contentType="text/html; charset=UTF-8"  
    pageEncoding="UTF-8"%>  
<%  
    System.out.println("Character encoding : "+request.getCharacterEncoding());  
    System.out.println("Character encoding : "+response.getCharacterEncoding());  
    response.setCharacterEncoding("UTF-8");  
%> 
于 2013-06-07T09:57:48.840 回答
0
于 2013-06-07T10:14:30.473 回答