|
Web DbForms(续一)(1)
Web DbForms (续一) (说明:由于本人水平有限,所以翻译错误在所难免。为了不给读者造成错误的概念,这里采用了中英文对照方式) A Simple Example 一个简单例子 Description: This JSP view (service.jsp) enables the user(s) to administer the services the agency provides to its customers. The user (an employee of the agency or call center agent) should get a list of all the existing services, along with textfields and buttons to update and delete data. Finally, an empty input mask for inserting new services is needed. 描述:此JSP视图(service.jsp)允许用户管理代理商提供给客户的服务。用户(代理商的一个雇员或者呼叫中心的代表)会得到一个所有存在的服务的列表,连同文本输入框和按钮一起来更新和删除数据。最后,需要一个空的输入界面来增加新的服务。 Listing 1. -- service.jsp <%-- import DbForms tag library --%> <%@ taglib uri="/WEB-INF/taglib.tld" prefix="db" %> <html> <head> <db:base/> </head> <body> <db:errors/> <%-- show eventually occured errors --%> <db:dbform tableName="service" maxRows="*" followUp="/service.jsp"> <%-- the header gets rendered one time --%> <db:header> <db:gotoButton caption="Menu" destination="/menu.jsp" /> <h1>Services we provide</h1> <center><h3>Our existing services</h3></center> <table border="5" width="60%" align="CENTER"> <tr> <th>ID</th> <th>Name</th> <th>Description</th> <th>Actions</th> </tr> </db:header> <%-- the body gets rendered for each data row in the query it contains textfields and action buttons for manipulating data --%>
|