一区二区三区在线-一区二区三区亚洲视频-一区二区三区亚洲-一区二区三区午夜-一区二区三区四区在线视频-一区二区三区四区在线免费观看

服務器之家:專注于服務器技術及軟件下載分享
分類導航

PHP教程|ASP.NET教程|Java教程|ASP教程|編程技術|正則表達式|C/C++|IOS|C#|Swift|Android|VB|R語言|JavaScript|易語言|vb.net|

服務器之家 - 編程語言 - Java教程 - JavaWeb開發之Spring+SpringMVC+MyBatis+SpringSecurity+EhCache+JCaptcha 完整Web基礎框架

JavaWeb開發之Spring+SpringMVC+MyBatis+SpringSecurity+EhCache+JCaptcha 完整Web基礎框架

2020-07-17 12:14夢游的龍貓 Java教程

這篇文章主要介紹了JavaWeb開發之Spring+SpringMVC+MyBatis+SpringSecurity+EhCache+JCaptcha 完整Web基礎框架的相關資料,需要的朋友可以參考下

簡單介紹一下,本框架的基本功能點:

  1. Spring:整個框架的主體部分,這個自不用說。
  2. SpringMVC:MVC部分我還是比較喜歡Spring的。
  3. MyBatis:選型的時候選擇這個ORM主要也是考慮其靈活性的問題,畢竟我也不知道,今后會遇到怎樣的需求,用Hibernate一來是不太會用,二來,我還是比較喜歡直接寫SQL來的簡單一點。
  4. SpringSecurity:這個主要是安全框架,負責用戶登錄驗證及整站權限分配的相關事項(權限分配真的很有用,這個我就不多說了)。
  5. EhCache:一個非常流行又非常簡單好用的緩存框架,并且目前已經支持分布式,如果覺得不好用,自己換成Redis也都OK。
  6. JCaptcha:一個簡單的驗證碼生成框架(或者說工具)。
  7. Log4J:現在沒人不知道這個日志框架吧...

  按照這樣的選型,基本可以完成大部分網站的基礎框架,如:

  1. 用戶登錄管理,
  2. 整站權限分配,
  3. 數據緩存,
  4. 登錄驗證碼,
  5. 數據庫操作,
  6. 統一異常處理,
  7. 日志輸出。

  網上找了很多文章,大部分都是只有部分整合的,比如SSH整合,SSM整合,SpringMVC+SpringSecurity,等等,東一塊,西一塊,非常分散,而且每個人的配置方式還不一樣,不統一,有的人喜歡注解配置,有的人喜歡XML配置,有的文章甚至直接就是有東沒西,神龍見首不見尾。看的我是很郁悶,很蛋疼,因為當我好不容易搭好一個SSM框架,我發現,我要管理用戶登錄及權限分配的時候,咦,我還得去配置Security,然后又要找很多文章來補充知識,配置Security的時候,又要找驗證碼的框架,都搞好了以后,發現誒,緩存這個東西不都是任何一個網站必備的嗎?所以就有了現在這篇文章,花了好大得勁,終于把所有都整合起來了。

只有自己親手走過一遍,才真正學得會知識。作為一個程序員,我相信這樣才是對我們是最好的一個方式。所以不要索要源碼,不會給的。 先給出整個項目的

Pom.xml

?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>com.magic.rent</groupId>
  <artifactId>ssm</artifactId>
  <packaging>war</packaging>
  <version>1.0-SNAPSHOT</version>
  <name>ssm Maven Webapp</name>
  <url>http://maven.apache.org</url>
  <repositories>
    <repository>
      <id>atlassian</id>
      <name>atlassian</name>
      <url>http://maven.jahia.org/maven2/</url>
    </repository>
  </repositories>
  <build>
    <finalName>ssm</finalName>
    <plugins>
      <!--Mybatis 逆向工程插件-->
      <plugin>
        <groupId>org.mybatis.generator</groupId>
        <artifactId>mybatis-generator-maven-plugin</artifactId>
        <version>1.3.2</version>
        <configuration>
          <verbose>true</verbose>
          <overwrite>true</overwrite>
        </configuration>
      </plugin>
    </plugins>
  </build>
  <properties>
    <security.version>4.1.3.RELEASE</security.version>
    <spring.version>4.3.3.RELEASE</spring.version>
  </properties>
  <dependencies>
    <!-- SpringFramework Start -->
    <dependency>
      <groupId>org.springframework</groupId>
      <artifactId>spring-core</artifactId>
      <version>${spring.version}</version>
    </dependency>
    <dependency>
      <groupId>org.springframework</groupId>
      <artifactId>spring-web</artifactId>
      <version>${spring.version}</version>
    </dependency>
    <dependency>
      <groupId>org.springframework</groupId>
      <artifactId>spring-oxm</artifactId>
      <version>${spring.version}</version>
    </dependency>
    <dependency>
      <groupId>org.springframework</groupId>
      <artifactId>spring-tx</artifactId>
      <version>${spring.version}</version>
    </dependency>
    <dependency>
      <groupId>org.springframework</groupId>
      <artifactId>spring-jdbc</artifactId>
      <version>${spring.version}</version>
    </dependency>
    <dependency>
      <groupId>org.springframework</groupId>
      <artifactId>spring-webmvc</artifactId>
      <version>${spring.version}</version>
    </dependency>
    <dependency>
      <groupId>org.springframework</groupId>
      <artifactId>spring-aop</artifactId>
      <version>${spring.version}</version>
    </dependency>
    <dependency>
      <groupId>org.springframework</groupId>
      <artifactId>spring-context-support</artifactId>
      <version>${spring.version}</version>
    </dependency>
    <dependency>
      <groupId>org.springframework</groupId>
      <artifactId>spring-test</artifactId>
      <version>${spring.version}</version>
    </dependency>
    <dependency>
      <groupId>org.springframework</groupId>
      <artifactId>spring-expression</artifactId>
      <version>${spring.version}</version>
    </dependency>
    <!-- SpringFramework End -->
    <!--SpringSecurity Start-->
    <dependency>
      <groupId>org.springframework.security</groupId>
      <artifactId>spring-security-core</artifactId>
      <version>${security.version}</version>
    </dependency>
    <dependency>
      <groupId>org.springframework.security</groupId>
      <artifactId>spring-security-web</artifactId>
      <version>${security.version}</version>
    </dependency>
    <dependency>
      <groupId>org.springframework.security</groupId>
      <artifactId>spring-security-config</artifactId>
      <version>${security.version}</version>
    </dependency>
    <dependency>
      <groupId>org.springframework.security</groupId>
      <artifactId>spring-security-taglibs</artifactId>
      <version>${security.version}</version>
    </dependency>
    <dependency>
      <groupId>org.springframework.security</groupId>
      <artifactId>spring-security-crypto</artifactId>
      <version>${security.version}</version>
    </dependency>
    <!--SpringSecurity End-->
    <!--aspectj start-->
    <dependency>
      <groupId>org.aspectj</groupId>
      <artifactId>aspectjweaver</artifactId>
      <version>1.8.6</version>
    </dependency>
    <dependency>
      <groupId>org.aspectj</groupId>
      <artifactId>aspectjrt</artifactId>
      <version>1.8.6</version>
    </dependency>
    <!--aspectj end-->
    <!--c3p0-->
    <dependency>
      <groupId>com.mchange</groupId>
      <artifactId>c3p0</artifactId>
      <version>0.9.5.1</version>
    </dependency>
    <!--servlet/jsp api start-->
    <dependency>
      <groupId>javax.servlet</groupId>
      <artifactId>servlet-api</artifactId>
      <version>2.5</version>
    </dependency>
    <dependency>
      <groupId>javax.servlet.jsp</groupId>
      <artifactId>jsp-api</artifactId>
      <version>2.1</version>
      <scope>provided</scope>
    </dependency>
    <!--servlet/jsp api end-->
    <!--junit4-->
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>4.11</version>
      <scope>test</scope>
    </dependency>
    <!--Mybatis-->
    <dependency>
      <groupId>org.mybatis</groupId>
      <artifactId>mybatis</artifactId>
      <version>3.3.0</version>
    </dependency>
    <!--Mybatis Spring整合-->
    <dependency>
      <groupId>org.mybatis</groupId>
      <artifactId>mybatis-spring</artifactId>
      <version>1.2.3</version>
    </dependency>
    <!--MySQL Driver-->
    <dependency>
      <groupId>mysql</groupId>
      <artifactId>mysql-connector-java</artifactId>
      <version>5.1.6</version>
    </dependency>
    <dependency>
      <groupId>jstl</groupId>
      <artifactId>jstl</artifactId>
      <version>1.2</version>
    </dependency>
    <!--JCaptcha驗證碼-->
    <dependency>
      <groupId>com.octo.captcha</groupId>
      <artifactId>jcaptcha</artifactId>
      <version>1.0</version>
    </dependency>
    <!--公共工具包-->
    <dependency>
      <groupId>org.apache.commons</groupId>
      <artifactId>commons-lang3</artifactId>
      <version>3.4</version>
    </dependency>
    <!--Ehcache緩存框架 start-->
    <dependency>
      <groupId>net.sf.ehcache</groupId>
      <artifactId>ehcache-core</artifactId>
      <version>2.6.11</version>
    </dependency>
    <!--Mybatis-Ehcache整合包-->
    <dependency>
      <groupId>org.mybatis</groupId>
      <artifactId>mybatis-ehcache</artifactId>
      <version>1.0.0</version>
    </dependency>
    <!--Ehcache-Web頁面及對象緩存-->
    <dependency>
      <groupId>net.sf.ehcache</groupId>
      <artifactId>ehcache-web</artifactId>
      <version>2.0.4</version>
    </dependency>
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-api</artifactId>
      <version>1.6.1</version>
    </dependency>
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-log4j12</artifactId>
      <version>1.6.2</version>
    </dependency>
    <!--Ehcache緩存框架 end-->
  </dependencies>
</project>

項目結構截圖

JavaWeb開發之Spring+SpringMVC+MyBatis+SpringSecurity+EhCache+JCaptcha 完整Web基礎框架

以上所述是小編給大家介紹的JavaWeb開發之Spring+SpringMVC+MyBatis+SpringSecurity+EhCache+JCaptcha 完整Web基礎框架,希望對大家有所幫助,如果大家有任何疑問請給我留言,小編會及時回復大家的。在此也非常感謝大家對服務器之家網站的支持!

原文鏈接:http://www.cnblogs.com/wuxinzhe/p/5922449.html

延伸 · 閱讀

精彩推薦
主站蜘蛛池模板: 99国产精品免费视频 | 精品国产理论在线观看不卡 | 欧美日韩国产在线人成 | 2012年免费中文视频 | 水岛津实在线 | 日韩综合第一页 | 国内久久久| 亚洲国产精品久久精品怡红院 | 五月婷婷俺来也 | 国色天香社区在线视频免费观看 | 色欧美在线 | 亚洲视频999 | 久久综合亚洲色hezyo | anal22日本人视频 | 9久re在线观看视频精品 | 日韩精品视频免费 | 男男按摩1069gⅴ | 欧美日韩亚洲综合久久久 | 亚洲qvod图片区电影 | 国产综合成人久久大片91 | 双性np肉文 | 欧美日韩亚洲区久久综合 | 欧美日韩国产在线人成dvd | 亚洲精品久久玖玖玖玖 | 久久这里都是精品 | 秋霞一级成人欧美理论 | 天天做天天爱天天综合网 | 欧美亚洲韩国 | 性欧美高清强烈性视频 | 国产精品久久久天天影视香蕉 | 国产精品免费视频一区一 | 免费欧美视频 | 久久全国免费观看视频 | 午夜久久久久久网站 | 99久久久久久久 | 成人在线播放 | 免费一级片在线 | 亚洲国产在线视频中文字 | 91大神大战高跟丝袜美女 | 国产一级大片免费看 | 成人免费福利网站在线看 |