Java Web应用框架 WEB4J
jopen
13年前
<p>WEB4J是一个Java Web应用框架,目标是让使用者建立简单,清晰和优雅的web应用。该框架同时也提供一个开发者工具来协助开发人员创建基于 WEB4J的 应用程序。</p> <p>下面是一个 WEB4J 的Action类源码:</p> <pre class="brush:java; toolbar: true; auto-links: false;">package hirondelle.electricity.main.report; import hirondelle.electricity.util.TemplatedPage; import hirondelle.web4j.model.AppException; import hirondelle.web4j.action.ActionImpl; import hirondelle.web4j.request.RequestParser; import hirondelle.web4j.action.ResponsePage; import hirondelle.web4j.database.SqlId; public class ReportAction extends ActionImpl { public static final SqlId LIST_HIGH_SPENDING = new SqlId("LIST_HIGH_SPENDING"); public ReportAction(RequestParser aRequestParser){ super(FORWARD, aRequestParser); } @Override public ResponsePage execute() throws AppException { ReportDAO dao = new ReportDAO(); addToRequest(ITEMS_FOR_LISTING, dao.list()); return getResponsePage(); } // PRIVATE // private static final ResponsePage FORWARD = TemplatedPage.get( "Example Report", "view.jsp", ReportAction.class ); }</pre> <p><strong>项目主页:</strong><a href="http://www.open-open.com/lib/view/home/1324786213280" target="_blank">http://www.open-open.com/lib/view/home/1324786213280</a></p> <p></p>