我正在开发使用JSF 1.1的工具,我有这样的问题: 我有我的支持bean一个字符串,它打印为:字符编码1.1
./src.cpp: In function ‘int main()’:
./src.cpp:4: error: ‘dsdada’ was not declared in this scope
上的txt文件。
但是,当我把它放在H:inputTextArea,它是这样的:
./src.cpp: In function ‘int main()’:
./src.cpp:4: error: ‘dsdada’ was not declared in this scope
-
<%@ page contentType="text/html;charset=UTF-8" %>
and this
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
</head>
但它也不能工作。 有人可以告诉我如何解决这个问题。由于
/* String[0] as stdout, String[1] as stderr */
String[] results = sshBO.execCommand(cmd, timeout);
/* Done with SSH things */
sshBO.closeSession();
/* Bring the output and err to the presentation */
msg = results[1]+results[0];
FileServices.saveStringToFile("F:/myoutput.txt", msg);
msg = new String(msg.getBytes("UTF8"), "UTF8"); /* makes no difference */
在JSP页面:
<%@ page contentType="text/html;charset=UTF-8" %>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
<%@ taglib uri="http://sakaiproject.org/jsf/sakai" prefix="sakai" %>
<f:view >
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
</head>
...
<h:inputTextarea disabled="true" value="#{SSH.msg}" styleClass="myTextArea" />
感谢BalusC,我尝试在我的页面中添加<%@ page pageEncoding =“UTF-8”%>,但它似乎不起作用。发生同样的问题。还有什么我应该尝试?顺便说一下,你有一个伟大的博客。我没有学习从你的博客上传文件:)。 – HoaPhan 2011-05-17 14:34:31