JSP中的中文字符处理
<%@ page contentType = "text/html;charset =gb2312"%>
<%!
public String codeToString(String str)
{
String s =str;
try{
byte[] tb = s.getBytes("ISO-8859-1");
s=new String(tb);
return s;
} catch(Exception e){
return s;
}
}
%>
<html>
<body>
<form name="form1" action="chinessString.jsp" method ="post">
please input your name
<input type ="text" name = "username">
<input type ="submit" name ="submit" value="submit">
</form> <br>
<%
if(request.getParameter("username")==null)
out.println("you don't input name");
else
out.println("your name is :"+codeToString(request.getParameter("username"
相关问答:
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
org.apache.jas ......
我JSP的页面是:
<%@ page language="java" contentType="text/html; charset=gb2312"
%>
<script>
function Save(){
xmlHttp=GetXmlHttpObject()
if(xmlHttp==nul ......
我是个新手,做一个JSP网页,我要读出数据库正常,但是我要修改的时候,也就是读入的时候出现乱码,请高手告诉我怎么解决,先谢谢了。
request.setCharacterEncoding("UTF-8");
把编码统一
/**
......
org.apache.jasper.JasperException: Unable to compile class for JSP:
An error occurred at line: 52 in the jsp file: /vip_info.jsp
ÕË cannot be resolved
49: <table border="1& ......
请问我的jsp为什么不能跳转,谢谢
<%@ page contentType="text/html; charset=utf-8" language="java" import="java.sql.*" errorPage="" %>
<!DOCTYPE html PUB ......