【发布时间】:2013-09-27 19:53:46
【问题描述】:
我是 Struts2 和 Hibernate 的新手。 I want to create a drop-down list like the following [ using hibernate and struts] which pops up a menu dynamically and when an id will be selected, it shows all the information of that id:
我为此做了很多努力。但失败了。谁能帮帮我:
我有一个这样的“学生”表:
id name age
1...a.....20
2...b.....24
3...c.....22
我使用 Hibernate 创建模型和 dao,例如... StudentModel 和 StudentDAO
在 DAO 中,我实现了一个返回 id 列表的方法,如下所示:
// StudentDAO.java
public List<String> findId(String id) {
.....
return ...
}
现在,我将 action 定义到 struts.xml 文件中,如下所示:
// Struts.xml
<action name="idSelection" class="..." method="findId">
<result> studentpage.jsp </result>
</action>
那么,现在我该如何实现studentpage.jsp。请你告诉我必要的代码或参考来做到这一点
谢谢。
【问题讨论】:
标签: java hibernate jsp struts2