易截截图软件、单文件、免安装、纯绿色、仅160KB

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");


相关文档:

解决netbeans写jsp出现中文乱码的问题


jsp表单提交的数据有中文时出现乱码,并非读取数据库数据后显示乱码,以下是解决的方法。
netbeans创建jsp的模版中是:<%@page contentType="text/html" pageEncoding="UTF-8"%>,将这行改成以下这样就可以正常显示中文:
<%@page language="java" pageEncoding=utf-8" %>
<%@page contentType=” ......

Jsp 连接 mySQL、Oracle 数据库备忘

Jsp 连接 mySQL、Oracle 数据库备忘
2009-12-15 16:47
Jsp 环境目前最流行的是 Tomcat5.0。Tomcat5.0 自己包含一个 Web 服务器,如果是测试,就没必要把 Tomcat 与 IIS 或 Apache 集成起来。在 Tomcat 自带的 Web 服务器下可以进行 Jsp 测试。
    安装 Tomcat5.0 前需要安装 JDK(如果是 Windows server ......

在JSP中配置FCKeditor 2.6.4

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 ......

servlet、jsp中获得项目绝对路径

servlet中获得项目绝对路径
String filePath=this.getServletConfig().getServletContext().getRealPath("/");
根目录所对应的绝对路径:request.getServletPath();
文件的绝对路径 :request.getSession().getServletContext().getRealPath(request.getRequestURI())
当前web应用的绝对路径 :servletConfig.getServletCo ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号