Joined: Tue Feb 21, 2006 11:30 pm Posts: 3 Location: Argentina
|
I have made a view configuration process class based on XML to Hibernate. I have made a TagLib to use it from JSP too.
Following are the examples about how to use it.
<< Views.xml >>
<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE view-maps PUBLIC
"-//Views/Views Configuration DTD 3.0//EN"
"http://localhost:9080/TestHibernate/views-configuration-1.0.dtd">
<view-maps>
<view name="messages">
<query>from Message</query>
</view>
</view-maps>
<< ViewTag.java >>
View view = new View("messages");
List records = view.makeSelection();
<< taglib.tld >>
<uri>HibernateTags</uri>
<tag>
<name>ViewTag</name>
<tagclass>org.hibernate.views.ViewTag</tagclass>
<bodycontent>JSP</bodycontent>
<info>ViewTag</info>
<attribute>
<name>bean</name>
<required>true</required>
</attribute>
<attribute>
<name>name</name>
<required>true</required>
</attribute>
</tag>
<< Test.jsp >>
<%@ taglib uri="/WEB-INF/taglib.tld" prefix="HibernateTags" %>
<HibernateTags:ViewTag name="messages" bean="message">
<b><jsp:getProperty name="message" property="someField" /></b>
</HibernateTags:ViewTag>
If somebody wanna I send it, let me know. If there are other project to do that, please tell me because I did not found it.
Best regards.
_________________ Alejandro Vidal Quiroga
|
|