HibtagsJSP 1.2 tag library for Hibernate 2.1 |
|
|
Example 2
This opens a session for a while, loads a given cat, and sets one of the properties. When the session closes, it will flush the bean and save the change.
<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>
<%@ taglib uri="http://hibtags.lokitech.com/taglib" prefix="hib" %>
<%-- Opens a hibernate session --%>
<hib:session>
<%-- Loads a cat with the primary key of request.getParameter("id") --%>
<hib:load var="cat" class="eg.Cat" value="${param.id}" />
<%-- calls cat.setName(request.getParameter("name")) --%>
<c:set target="${cat}" property="name" value="${param.name}" />
<%-- Closes and flushes the session, saving the change --%>
</hib:session>
Uses
|
Home
Examples Documentation Mailing list Download About Us License CVS SF page |