appfuse remarks

The first part of Appfuse basic information
1. Appfuse3.5 construction process
(1) Install jdk, install maven
c:\workspace\appfuse\>mvn archetype:generate -B -DarchetypeGroupId=org.appfuse.archetypes -DarchetypeArtifactId=appfuse-basic-spring -archetype -DarchetypeVersion=3.5.0 -DgroupId=com.xxx -DartifactId=a -DarchetypeRepository=https://oss.sonatype.org/content/repositories/appfuse

mvn appfuse:full-source
Enable MySQL5
mvn jetty:run
automatic build Table
mvn eclipse: eclipse
import eclipse

2. Familiar with appfuse structure
Import eclipse, jdk1.8, tomcat8.0 running Chinese with garbled characters.
Running Chinese with jetty is normal.
The problem is mainly in i18n internationalization, the garbled file is:
/a/src/main/resources/ApplicationResources_zh.properties
/a/src/main/resources/ApplicationResources_zh_CN.properties
/a/src/main/resources/displaytag_zh.properties
/a/src/main/resources/displaytag_zh_CN.properties
Install the plug-in Properties Editor plug-in in eclipse, it is very convenient to edit the above files.
After opening, save, and then run the project, the garbled characters are eliminated.

The home page file is: /a/src/main/webapp/login.jsp login page
The page is decorated, the decoration page: decorators/default.jsp The
decoration configuration file: /WEB-INF/decorators.xml file.




3. Component
3.1, sitemesh component, using decorator design pattern,
version: 2.4.2

3.2, Spring Security component
version : 3.2.5
Official website document reference: http://docs.spring.io/spring-security/site/docs /3.2.5.RELEASE/reference/htmlsingle/
3.3, Struts Menu component
Version : 2.4.3
http://www.blogjava.net/gdufo/archive/2008/06/26/210947.html
http://zhouliming- 521.iteye.com/blog/125083
http://blog.csdn.net/springmvc_freemarker/article/details/50384600
3.4, Velocity Template Engine
Version : 1.7
http://blog.csdn.net/qq_25237663/article/details/52262532
http://blog.csdn. net/nengyu/article/details/6671904
https://www.ibm.com/developerworks/cn/java/j-lo-velocity1/
http://ifeve.com/apache-velocity-dev/#header

3.5, URLWriting
Version: 4.0.3

3.6, displaytag
version: 1.2

3.7, Hibernate
version: 4.3.6
http://docs.jboss.org/hibernate/orm/4.3/manual/en-US/html_single/
http://docs.jboss .org/hibernate/orm/4.3/devguide/en-US/html_single/

3.8, Spring
version: 4.1.3



The second part of creating an entity class
Steps :
1. Use the client tool to create a table in the database.
2. Eclipse automatically generates entity classes, project, right-click, JPA tools, and generate entity classes according to database tables.
3. The entity class is automatically added in /META-INF/persistence.xml under the project resources.
4. The new entity class is added in hibernate.cfg.xml.
Note: When mapping entity classes, it is recommended to change the int type to Integer
. When passing values ​​from the foreground to the background, pay attention to the space problem. When querying, avoid the query result set.


Appfuse3.5 Open Hibernate's show_sql log method
Environment JDK1.8+Tomcat8
Add the -Dorg.jboss.logging.provider=slf4j parameter to the Tomcat startup item.
Open the Server, Overview page, Open launch configuration, in the Arguments tab, and finally add in the VM arguments box: -Dorg.jboss.logging.provider="slf4j" After adding the parameters and starting Tomcat, you can see the sql executed by hibernate.



Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326431063&siteId=291194637