try
----------
<%
String str =getChinese((String)request.getParameter("word"))
%>
<%!
public String getChinese(String str) { //取汉字
try {
String temp_p = str;
byte[] temp_t = temp_p.getBytes("ISO8859-1");
String temp = new String(temp_t);
return temp;
}
catch (Exception e) {
e.printStackTrace();
}
return "";
}
%>
----------
<%
String str =getChinese((String)request.getParameter("word"))
%>
<%!
public String getChinese(String str) { //取汉字
try {
String temp_p = str;
byte[] temp_t = temp_p.getBytes("ISO8859-1");
String temp = new String(temp_t);
return temp;
}
catch (Exception e) {
e.printStackTrace();
}
return "";
}
%>
解决方案 »
- jquery解析xml数据的问题
- chrome 兼容模拟点击click的解决方法是什么哩?
- 求一个点击小图显示大图的函数
- 求一个特效,鼠标拖放
- 一js做的时钟,有些地方看不懂(已列出),运行出结果不正确,请帮忙,谢谢
- 怎么实现(当父窗口关闭时,其它的弹出子窗口也关闭?)
- 大哥,大姐,大爷进来一下下
- overflow怎么用啊,这样用怎么没有效果呢,大家帮我看一下.
- 关于用javascript实现获取checkbox值得功能!50分!在线等!
- 得到表单的属性值
- 如何获取页面上所有的type=radio 的表单是否全部填写
- 请问在javascrip中,this.config={target :null,folderLinks :true}是什么意思?
var word=word;
var showall=window.open("word.jsp?word="+encodeURI(word),"allcontent","toolbar=no,width=600,height=600,top="+(screen.height-600)/2+",left="+(screen.width-600)/2+";,directories=no,status=no,scrollbars=yes,resizable=yes,menubar=no");
}
-----------------
<%@page pageEncoding="gb2312" %>
<meta http-equiv="Content-type" content="text/html;charset=gb2312">
<%
String str = getChinese((String)request.getParameter("word"));
System.out.println(str);
out.println(str);
%>
<%!
public String getChinese(String str) { //取汉字
try {
String temp_p = str;
byte[] temp_t = temp_p.getBytes("ISO8859-1");
String temp = new String(temp_t);
return temp;
}
catch (Exception e) {
e.printStackTrace();
}
return "";
}
%>