我在将参数传递给 Oracle ADF 中 JSP 中的托管 bean 时遇到问题。这是一个示例 JSP 测试页面,我试图将参数传递给 POJO 中的测试方法:
<?xml version='1.0' encoding='windows-1252'?>
<jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.1"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:af="http://xmlns.oracle.com/adf/faces/rich">
<jsp:directive.page contentType="text/html;charset=windows-1252"/>
<f:view>
<af:document title="Automated Scheduling Tool > Customer Portal > Packages"
id="d1">
<af:messages id="m1"/>
<af:form id="f1">
<center>
<br/><br/><br/>
<table cellspacing="0" cellpadding="45" width="800">
<tr>
<td width="100%" class="darkBackground">
<span class="largeTitle">AUTOMATED SCHEDULING TOOL</span>
<br/>
<span class="mediumTitle">CUSTOMER PORTAL</span>
</td>
</tr>
<tr>
<af:outputText value="#{pageFlowScope.customerFacadeBean.test['test1', 'test2']}" id="ot1" />
</tr>
</table>
</center>
</af:form>
</af:document>
</f:view>
</jsp:root>
public class CustomerFacade {
private final PackageMapper mapper;
private List<Package> packages;
public CustomerFacade() {
mapper = new PackageMapper();
packages = mapper.findAllPackages();
}
public List<Package> getPackages() {
return packages;
}
public String test(String testString1, String testString2){
System.out.println(testString1 + testString2);
return "Success!";
}
}
有人对我如何通过托管 bean 将参数传递给 POJO 有任何建议吗?