\" + (inputIndex++));
input.setValue(\"Input 1\"); [Page]
input.setRendered(true);
form1.getChildren().add(input);
return null;
}
}
<%@ page contentType=\"text/html; charset=UTF-8\" %>
<%@ taglib uri=\"http://java.sun.com/jsf/html\" prefix=\"h\" %>
<%@ taglib uri=\"http://java.sun.com/jsf/core\" prefix=\"f\" %>
<html>
<head>
<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\"/>
<title></title>
</head>
<body>
<f:view>
<h:form id=\"form1\">
<h:commandButton id=\"commmand1\" action=\"#{dymaComponent.getComponentsList}\" value=\"Print ViewRoot\"></h:commandButton>
<h:commandButton action=\"#{dymaComponent.addTextBox}\" value=\"Add TextBox\"></h:commandButton>
</h:form>
</f:view>
</body>
</html>
<?xml version=\"1.0\" encoding=\"UTF-8\"?>
<faces-config
xmlns=\"http://java.sun.com/xml/ns/javaee\"
xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"
xsi:schemaLocation=\"http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_1_2.xsd\"
version=\"1.2\">
<managed-bean>
<managed-bean-name>
dymaComponent</managed-bean-name>
<managed-bean-class>
net.moon.DymaComponent</managed-bean-class> [Page]
<managed-bean-scope>
session</managed-bean-scope>
</managed-bean>
</faces-config> 中国自学编程网整理发布,www.zxbc.cn。