---
title: "黑马程序员：struts2 获取一对多关系的对象的对象的属性"
author: "kingdelee"
date: "2012-06-02T17:06:06Z"
tags: []
categories: ["编程语言"]
slug: "struts2"
draft: false
lastmod: "2012-07-22T14:55:02Z"
id: 1547298
url: "https://kingdelee.iteye.com/blog/1547298"
---

\[align=center]------- \[url=http://edu.csdn.net/heima]android培训 \[/url]、\[url=http://edu.csdn.net/heima]java培训\[/url]、期待与您交流！------- \[/align] struts2 获取一对多关系的对象的对象的属性 http://blog.sina.com.cn/s/blog\_67b9ad8d0100yat1.html http://tiger-hu.iteye.com/blog/1032623 通过下面的JSP代码可以发现，一些等价关系： \[code="java"] //取对象时 与 ${patient.id} 等价 ${patient.person.id} 与 等价 与${person.id}等价 \[/code] \[code="java"] &lt;%@ page language="java" pageEncoding="UTF-8"%&gt; &lt;%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%&gt; &lt;%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%&gt; &lt;%@ page isELIgnored="false" %&gt; &lt;% String path = request.getContextPath(); %&gt; &lt;%@taglib prefix="s" uri="/struts-tags"%&gt;

## 用户列表

个人ID 病人ID 用户名 挂号单时间 就诊科目 主诉 诊断 费用 [](Person-showPerson?id=%3Cs%3Aproperty%20value%3D%27#patient.person_id%27/%3E)[](Patient-showPatient?id=%3Cs%3Aproperty%20value%3D%27#patient.id%27/%3E)[删除挂号单](Patient-delete?id=%3Cs%3Aproperty%20value%3D%27#patient.id%27/%3E) [更新挂号单](Patient-update.jsp?id=%3Cs%3Aproperty%20value%3D%27#patient.id%27/%3E)

 病人挂号信息管理  个人ID 病人ID 用户名 挂号单时间 就诊科目 主诉 诊断 费用 修改 删除 6

[添加新挂号单](Patient-add.jsp) \[/code] \[align=center]------- \[url=http://edu.csdn.net/heima]android培训 \[/url]、\[url=http://edu.csdn.net/heima]java培训\[/url]、期待与您交流！------- \[/align] \[align=center]详细请查看：\[url=http://edu.csdn.net/heima]http://edu.csdn.net/heima \[/url]------- \[/align]