错误:未知函数getHello。检查拼写

时间:2012-12-25 10:06:54

标签: salesforce apex-code visualforce

我正在编写一个visualforce页面代码:

<apex:page controller="AuthSubController" showHeader="false">
<head><title>Hello World</title>
<meta name="google-site-verification" content="XCzApP9fdbR3auxPHd3-X0g7uCNbrXZDQU_jm5GHXLI" />
</head>
     <apex:outputPanel rendered="{!$CurrentPage.parameters.token != null}"> 

The one time use token is :<b>{!$CurrentPage.parameters.token}</b>
            <br />
Record to update is {!$CurrentPage.parameters.id}
<br />
URL to update is {! getHello($CurrentPage.parameters.url)}


     </apex:outputPanel>

</apex:page>

和顶点控制器段是

public class AuthSubController {
    public string getHello(String x) {
        return x.substring(3);
    }
}

我在Controller类中定义了getHello。有人可以告诉我为什么会收到这个错误吗?

1 个答案:

答案 0 :(得分:1)

变化:

URL to update is {! getHello($CurrentPage.parameters.url)}

为:

URL to update is { !Hello($CurrentPage.parameters.url) }

会好的。