1

我正在使用 JSF 1.1 开发一个工具,但我遇到了这个问题:我的支持 bean 中有一个字符串,打印为:

./src.cpp: In function ‘int main()’:
./src.cpp:4: error: ‘dsdada’ was not declared in this scope

在一个txt文件上。

但是当我把它放在 ah: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" />
4

2 回答 2

1
于 2011-05-15T14:54:02.380 回答
0
于 2012-06-18T08:46:10.660 回答