jsp页面乱码问题
分两种:
Get方式传递数据解决办法:
<%
String username = request.getParameter("username");
byte[] bytes = username.getBytes("iso-8859-1");
String result = new String(bytes, "gb2312");
out.print(result);
%>
Post方式解决办法:request.setCharacterEncoding("gb2312");
相关文档:
jsp表单提交的数据有中文时出现乱码,并非读取数据库数据后显示乱码,以下是解决的方法。
netbeans创建jsp的模版中是:<%@page contentType="text/html" pageEncoding="UTF-8"%>,将这行改成以下这样就可以正常显示中文:
<%@page language="java" pageEncoding=utf-8" %>
<%@page contentType=” ......
最基本的乱码问题
这个乱码问题是最简单的乱码问题。一般新会出现。就是页面编码不一致导致的乱码。
Html代码:
<%@ page language="java" pageEncoding="UTF-8"%>
<%@ page contentType="text/html;charset=iso8859-1"%>
<html>
<head>
<title ......
1.FCKeditor 介绍
FCKeditor 这个开源的HTML 文本编辑器可以让web 程序拥有如MS Word 这样强大的编辑功能,.FCKeditor 支持当前流行的浏览器。
2.准备工作:
环境:winddows XP、tomcat6.0、JDK1.6
下载:
1):FCKeditor_2.6.4.zip
地址:http://nchc.dl.sourceforge.net/sourceforge/fckeditor/FCKeditor_2.6.4.zip ......
在线网页编辑器中最著名的是fckEditor,但他的功能太全面了,而且使用起来也不是很方便。相对而言新浪htmleditor就比较清爽,而且使用简单。新浪博客和人人网日志应该都是用的这个控件。但是htmleditor最多的是asp版本,在网站jsp版本十分稀少。通过查找我找到一个可以使用的新浪htmleditor jsp版本。下载地址为http://down ......
实现JSP自定义标签的一种方法:
1.写一个类继承TagSupport或其他Tag的实现类。
public class AllTag extends TagSupport {
@Override
public int doStartTag() throws JspException {
JspWriter out = pageContext.getOut();
try {
out.append("Hello World.");
} catch (IOException e) {
e.pri ......