https://github.com/ykameshrao/spring-hibernate-springdata-springmvc-maven-project-framework
該項目包括以下部分:
1) Commons-Deps :依賴聲明為單個pom文件,以輕松管理項目依賴。 用戶仍然可以繼續選擇這種方式,或者繼續使用自己選擇的方法來管理Maven Pom中的依賴關系,這取決于用戶的個人選擇。
2) Commons :Commons jar模塊提供了許多通用代碼段,以幫助使用gmail,java郵件,utf8編碼,JCS緩存管理器,會話管理器,隨機字符串等發送郵件。
3) 框架 :代碼庫的此部分包括JPA和Spring數據實體,JPA和Spring數據存儲庫,使用Java泛型構建的服務,以在用戶構建自己的特定于域的實體,存儲庫和服務時,對這些實體提供CRUD操作。服務擴展了此處提供的服務。 它還包含API和Web App控制器,再次為有興趣使用它們構建自己的Spring MVC控制器的人們提供基本功能。 另外,這里包含驗證器,異常,基于AOP的異常處理程序。
4) 您自己的Web應用程序代碼 :這部分代碼提供了一個帶有API和Web UI的自舉Web項目,使用了我在一段時間內選擇的最佳實踐來使用第三方框架(在這里選擇了庫)來做事。 API部分配置為接受并生成XML和JSON請求和響應格式。 這里還對Akka進行了配置,以展示可用于從Spring MVC控制器(Servlet)卸載活動的方法。 在這里,它被編程以減輕發送電子郵件的任務。
這是包裝器框架,用于開始使用Java編程語言使用Hibernate ORM層或基于Spring Data ORM的NoSQL和Spring MVC構建基于Spring的Web應用程序。 該項目的目的是讓您通過廣泛使用和經過測試的Java Web開發基礎結構快速開始Java Web App開發。
該項目提供了示例休眠實體,spring數據實體,akka actor,以減輕諸如作業,模型,存儲庫,服務和控制器類之類的郵件發送的負擔。 還有許多框架級別的類可幫助您處理可能由此開始開發的項目中的異常和錯誤。 此框架中捆綁的默認簡單Web項目的UI使用Twiiter引導程序,Apache Tiles,jQuery,jQuery驗證,JSP構建。
我可以在這里盡力提供盡可能多的細節,但是理解所提供全部內容的最佳方法是閱讀代碼。 因此,我還提供了一個示例Web應用程序項目,該項目具有注冊和登錄用戶的功能。 所有代碼都以包結構形式提供,可以根據您自己的選擇和要求對其進行重命名。 請享用!
配置 config / props / mail.properties
mail.transport.protocol=smtps mail.host=smtp.gmail.com mail.user= mail.pass= mail.port=465 mail.starttls=true mail.auth=true mail.debug=true mail.fromAddress=
config / props / database.properties
jdbc.driverClassName=com.mysql.jdbc.Driver jdbc.url=jdbc:mysql://localhost:3306/yourwebprojectdb jdbc.username= jdbc.password= hibernate.c3p0.min_size=5 hibernate.c3p0.max_size=20 hibernate.c3p0.timeout=600 hibernate.c3p0.max_statements=50
src / main / resources / tiles / templates.web.xml
<?xml version=”1.0” encoding=”UTF-8” ?> <!DOCTYPE tiles-definitions PUBLIC ”-//Apache Software Foundation//DTD Tiles Configuration 2.0//EN” ”http://tiles.apache.org/dtds/tiles-config_2_0.dtd”><tiles-definitions><definition name=”base” template=”/WEB-INF/views/layout/web.jsp”><put-attribute name=”title” value=”” /><put-attribute name=”header” value=”/WEB-INF/views/common/header.web.jsp” /><put-attribute name=”message” value=”/WEB-INF/views/common/message.web.jsp” /><put-attribute name=”content” value=”” /><put-attribute name=”footer” value=”/WEB-INF/views/common/footer.web.jsp” /></definition><definition name=”home” extends=”base”><put-attribute name=”title” value=”Your Web Project” /><put-attribute name=”content” value=”/WEB-INF/views/web/home.web.jsp” /></definition><definition name=”userRegistration” extends=”base”><put-attribute name=”title” value=”Register” /><put-attribute name=”content” value=”/WEB-INF/views/web/userRegistration.web.jsp” /></definition><definition name=”dashboard” extends=”base”><put-attribute name=”title” value=”Dashboard” /><put-attribute name=”content” value=”/WEB-INF/views/web/dashboard.web.jsp” /></definition><definition name=”error” extends=”base”><put-attribute name=”title” value=”Error” /><put-attribute name=”content” value=”/WEB-INF/views/web/error.web.jsp” /></definition> </tiles-definitions>
需要啟動VM選項
-Dconf.path=”path-to-config-folder-on-target-machine-containing-property-files”
請參閱:src / main / resources / config / spring / applicationContext-properties.xml
<util:properties id=”mdbProps” location=”file:#{systemProperties[‘conf.path’]}/config/props/mongodb.properties” /> <util:properties id=”dbProps” location=”file:#{systemProperties[‘conf.path’]}/config/props/database.properties” /> <util:properties id=”logProps” location=”file:#{systemProperties[‘conf.path’]}/config/props/log4j.properties” /> <util:properties id=”amProps” location=”file:#{systemProperties[‘conf.path’]}/config/props/api.messages.properties” />::
屏幕截圖





支持在一起的框架在此框架代碼層中支持多種活動,它們是–
Maven Java 1.7
春天3.1.1
休眠4+
Spring數據
MongoDB
阿卡1.3+
Apache Tiles 2+
Twitter Bootstrap 2+
郵件速度
引導表
jQuery的
參考:來自OrangeApple博客的JCG合作伙伴 Y Kamesh Rao提供的Spring,Hibernate,Spring Data,Akka,Twitter Bootstrap,Apache Tiles,jQuery支持的Maven Java Web項目Kickstarter代碼 庫 。
翻譯自: https://www.javacodegeeks.com/2012/08/maven-web-project-kickstarter-codebase.html