We would like to build an approachable framework for learning and understanding the Java Web programming techniques. It is very funny and easy to read the sample codes in the project. We built it with the MVC design pattern, which is the most famous design pattern all around the world.
- Maven Management Tool
- Spring & Spring MVC
- MyBatis
- Slf4J Log Facade
- logback Log Framework
- ...
-- src
--- main
---- java
----- (..., similar to group-id),"Package path"
-------- controller,"Controllers"
-------- domain,"Pojo Beans"
----------- po,"Persistence Object"
----------- vo,"Value Object"
----------- ro,"Read Object"
-------- persistence,"MyBatis Persistence Interfaces"
-------- service,"Services Package"
----------- impl,"Services Logic Detail"
---- resource, "Resources package"
-------- config, "Configuration Files for each of specific environments"
-------- mybatis, "MyBatis SQL descriptions with xml format"
-------- spring, "Configuration Files of Spring & Spring MVC frameworks"
---- webapp, "Web Project Package"
-------- WEB-INF,"WEB-INF directory design for Java Web Project"
-
You need to install a MySQL database, our project depends on it because of MyBatis usages.
-
To modify parameters of database resource, which wrote on the file
config/config-dev.properties
. -
After finishing two steps above, you could now start up your server/container such as Jetty/Tomcat/JBoss.
-
Any of URLs below will show you some information that generated by project services.
- http://localhost:8080/index?id=1
- http://localhost:8080/json
- http://localhost:8080/json4/{id}, you could replace
{id}
with any integer value. - http://localhost:8080/db, this could help you query the db data.
-
Here is the db table structures, this table is just design for developing, not for production environment.
CREATE TABLE `param` (
`id` int(11) NOT NULL AUTO_INCREMENT,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='demo';
P.E-framework-for-java has only one branch, and it is the only one used for active development.
master
for development. All pull requests should be submitted againstmaster
.
Follow and contact me on GitHub, Sina Weibo. If you find an issue, just open a ticket on it. Pull requests are warmly welcome as well.
- Jerome Chan
- GitHub: https://github.com/jeromechan
- Weibo: http://weibo.com/5812529126
- Blog: http://aboutcoder.com
Open sourced under the MIT license.