http://www.kissjava.com/doc/javamore/struts/2004-11-05/4303.php
http://www.gridchina.org/~ltguo/blog/archives/cat_study.html

解决方案 »

  1.   

    找一下struts的api文档吧,网上现成的例子比较少
      

  2.   

    <%@ page language="java" %>
    <%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
    <%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
    <%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
    <%@ taglib uri="/WEB-INF/struts-nested.tld" prefix="nested" %>
    <%@ page import="java.util.Vector" %>
    <%@ page import="ch15.Person" %>
    <%@ page import="ch15.Address" %>
    <html:html>
    <head>
    <title>Misc Nested sample code</title>
    </head>
    <body bgcolor="white"><h3>Misc Nested sample code</h3><p>This page provides examples of the following Struts NESTED tags:<br>
    <ul>
    <li>&lt;nested:nest&gt;</li>
    <li>&lt;nested:select&gt;</li>
    <li>&lt;nested:text&gt;</li>
    <li>&lt;nested:writeNesting&gt;</li>
    </ul><%--
    The following section shows nest.
    --%>
    <html:form action="/showPerson">
    <nested:nest property="person">
    Last Name: <nested:text property="lastName"/><BR>
    First Name: <nested:text property="firstName"/><BR>
    Age: <nested:text property="age"/><BR>
    Gender: <nested:select property="gender">
    <html:option value="MALE">Male</html:option>
    <html:option value="FEMALE">Female</html:option>
    </nested:select><P>
    <nested:nest property="address">
    Current nesting is: <nested:writeNesting/><BR>
    Street 1: <nested:text property="street1"/><BR>
    Street 2: <nested:text property="street2"/><BR>
    City: <nested:text property="city"/><BR>
    State: <nested:text property="state"/><BR>
    Postal Code: <nested:text property="postalCode"/><BR>
    </nested:nest>
    </nested:nest>
    <html:submit/>
    </html:form>
    </html:body>
    </html:html>