jsp中包含.html 页面,出现乱码
JSP是容易出现乱码问题,不过你只要注意以下几点就一定能搞定 可参考http://www.historycreator.com/bbs/2009-10/19/033181872.html
1、保证你的文本编码与你所期望的编码相符(用写字板打开你的页面然后文件另存为,在编码位置选择你期望的文本编码,GB2312对应ANSI,UTF8当然对于UTF8了)
2、保证代码里面的声明编码与你的文本编码相符即:charset=gb2312"和<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
3、保证你的项目内所有页面编码统一,不要UTF8的页面嵌套或引用GB2312的页面,这样一定出现乱码
4、数据库的编码与你项目编码保证一致
5、推荐使用配置myeclips为你JSP的开发工具,能有效降低你出现乱码的可能
相关文档:
I used Eclipse to try the google app engine demo project: guestbook.
when i create a *.jsp file in the WAR directory,the error information appear:
"Your Web Application Project must be configured to use a JDK in order to use JSPs."
solution:
It is because Eclipse put the JRE to the JRE directory ......
package com.gc.tool;
import java.util.ArrayList;
import java.util.List;
public class MyPagination {
private int recordCount = 0;
private int pagesize = 0;
private int maxPage = 0;
&n ......
<html>
<head>
<title>
基础HTML学习
</title> <t/标题/t>
& ......
代码如下:
Function RemoveHTML(strText)
Dim RegEx
Set RegEx = New RegExp
RegEx.Pattern = "<[^>]*>"
RegEx.Global = True
RemoveHTML = RegEx.Replace(strText, "")
RemoveHTML = replace(RemoveHTML," "," ")
End Function
这是最基本的正则替换,有某些特殊字符还没过滤,可自行添加 ......
一、在JSP页面中读取本地文件内容:
<%
try {
BufferedReader in = new BufferedReader(new FileReader("D:/test.txt"));
String file = "";
String temp = "";
&n ......