【发布时间】:2016-01-26 09:48:30
【问题描述】:
编辑:将${h.helloWorldName('Audren')} 与${h.getHelloWorldName('Audren')} 交换
我有一个测试班:
public class classtest {
private String helloWorld;
private String helloWorldName;
public String getHelloWorld(){
return "Hello world!";
}
public void setHelloWorld(String s) {
helloWorld = s;
}
public String getHelloWorldName(String s) {
return getHelloWorld() + s;
}
在我的 jsp 中,我想打印我的方法 getHelloWorldName 的结果。这是我到目前为止所尝试的:
<jsp:useBean id="h" class="com.test.classtest" scope="page" />
<c:out value="${h.helloWorldName('Audren'}" />
但没有成功。我错过了什么吗?我也试过#{h.helloWorldName('Audren'}
【问题讨论】: