Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
B
bigsys
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
bigsys
Commits
1bf305cd
Commit
1bf305cd
authored
Aug 15, 2017
by
Paul0523
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
重构代码
parent
6b7eed13
Changes
34
Hide whitespace changes
Inline
Side-by-side
Showing
34 changed files
with
226 additions
and
88 deletions
+226
-88
bigsys-auth/pom.xml
bigsys-auth/pom.xml
+8
-8
bigsys-auth/src/main/java/com/bigsys/auth/MyController.java
bigsys-auth/src/main/java/com/bigsys/auth/MyController.java
+3
-6
bigsys-auth/src/main/resources/dubbo-config.xml
bigsys-auth/src/main/resources/dubbo-config.xml
+1
-1
bigsys-auth/src/main/resources/spring-mvc.xml
bigsys-auth/src/main/resources/spring-mvc.xml
+1
-1
bigsys-dubbo/pom.xml
bigsys-dubbo/pom.xml
+1
-1
bigsys-dubbo/src/main/java/com/bigsys/dubbo/App.java
bigsys-dubbo/src/main/java/com/bigsys/dubbo/App.java
+1
-1
bigsys-dubbo/src/test/java/com/bigsys/AppTest.java
bigsys-dubbo/src/test/java/com/bigsys/AppTest.java
+1
-1
bigsys-redis/pom.xml
bigsys-redis/pom.xml
+1
-1
bigsys-redis/src/main/java/com/bigsys/redis/App.java
bigsys-redis/src/main/java/com/bigsys/redis/App.java
+1
-3
bigsys-redis/src/main/java/com/bigsys/redis/api/TestService.java
...redis/src/main/java/com/bigsys/redis/api/TestService.java
+1
-1
bigsys-redis/src/main/java/com/bigsys/redis/service/TestServiceImpl.java
...c/main/java/com/bigsys/redis/service/TestServiceImpl.java
+2
-2
bigsys-redis/src/main/resources/applicationContext.xml
bigsys-redis/src/main/resources/applicationContext.xml
+2
-2
bigsys-redis/src/test/java/com/bigsys/AppTest.java
bigsys-redis/src/test/java/com/bigsys/AppTest.java
+1
-1
bigsys-shiro/pom.xml
bigsys-shiro/pom.xml
+3
-3
bigsys-shiro/src/main/java/com/bigsys/shiro/App.java
bigsys-shiro/src/main/java/com/bigsys/shiro/App.java
+1
-1
bigsys-shiro/src/main/java/com/bigsys/shiro/Login.java
bigsys-shiro/src/main/java/com/bigsys/shiro/Login.java
+8
-8
bigsys-shiro/src/main/java/com/bigsys/shiro/model/User.java
bigsys-shiro/src/main/java/com/bigsys/shiro/model/User.java
+25
-0
bigsys-shiro/src/main/java/com/bigsys/shiro/realm/UserRealm.java
...shiro/src/main/java/com/bigsys/shiro/realm/UserRealm.java
+42
-0
bigsys-shiro/src/main/java/com/bigsys/shiro/service/UserService.java
...o/src/main/java/com/bigsys/shiro/service/UserService.java
+21
-0
bigsys-shiro/src/main/resources/applicationContext-shiro.xml
bigsys-shiro/src/main/resources/applicationContext-shiro.xml
+0
-29
bigsys-shiro/src/main/resources/bigsys-shiro.xml
bigsys-shiro/src/main/resources/bigsys-shiro.xml
+41
-0
bigsys-shiro/src/main/resources/static/login.html
bigsys-shiro/src/main/resources/static/login.html
+14
-0
bigsys-shiro/src/test/java/com/bigsys/AppTest.java
bigsys-shiro/src/test/java/com/bigsys/AppTest.java
+1
-1
bigsys-spring/pom.xml
bigsys-spring/pom.xml
+1
-3
bigsys-spring/src/main/java/com/bigsys/spring/App.java
bigsys-spring/src/main/java/com/bigsys/spring/App.java
+1
-1
bigsys-user/pom.xml
bigsys-user/pom.xml
+1
-1
bigsys-user/src/main/java/com/bigsys/user/App.java
bigsys-user/src/main/java/com/bigsys/user/App.java
+1
-1
bigsys-user/src/test/java/com/bigsys/AppTest.java
bigsys-user/src/test/java/com/bigsys/AppTest.java
+1
-1
bigsys-webdemo/pom.xml
bigsys-webdemo/pom.xml
+7
-2
bigsys-webdemo/src/main/java/com/bigsys/webdemo/TestController.java
...demo/src/main/java/com/bigsys/webdemo/TestController.java
+7
-1
bigsys-webdemo/src/main/resources/applicationContext.xml
bigsys-webdemo/src/main/resources/applicationContext.xml
+5
-4
bigsys-webdemo/src/main/resources/spring-mvc.xml
bigsys-webdemo/src/main/resources/spring-mvc.xml
+3
-1
bigsys-webdemo/src/main/webapp/WEB-INF/web.xml
bigsys-webdemo/src/main/webapp/WEB-INF/web.xml
+18
-1
pom.xml
pom.xml
+1
-1
No files found.
bigsys-auth/pom.xml
View file @
1bf305cd
...
...
@@ -2,7 +2,7 @@
xsi:schemaLocation=
"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"
>
<parent>
<artifactId>
bigsys
</artifactId>
<groupId>
com.
paul
</groupId>
<groupId>
com.
bigsys
</groupId>
<version>
1.0-SNAPSHOT
</version>
</parent>
<modelVersion>
4.0.0
</modelVersion>
...
...
@@ -22,25 +22,25 @@
<dependencies>
<dependency>
<groupId>
com.
paul
</groupId>
<artifactId>
dubbo
</artifactId>
<groupId>
com.
bigsys
</groupId>
<artifactId>
bigsys-
dubbo
</artifactId>
<version>
1.0-SNAPSHOT
</version>
</dependency>
<dependency>
<groupId>
com.
paul
</groupId>
<artifactId>
shiro
</artifactId>
<groupId>
com.
bigsys
</groupId>
<artifactId>
bigsys-
shiro
</artifactId>
<version>
1.0-SNAPSHOT
</version>
</dependency>
<dependency>
<groupId>
com.
paul
</groupId>
<artifactId>
redis-util
</artifactId>
<groupId>
com.
bigsys
</groupId>
<artifactId>
bigsys-redis
</artifactId>
<version>
1.0-SNAPSHOT
</version>
</dependency>
<dependency>
<groupId>
com.
paul
</groupId>
<groupId>
com.
bigsys
</groupId>
<artifactId>
bigsys-spring
</artifactId>
<version>
1.0-SNAPSHOT
</version>
</dependency>
...
...
bigsys-auth/src/main/java/com/
paul
/auth/MyController.java
→
bigsys-auth/src/main/java/com/
bigsys
/auth/MyController.java
View file @
1bf305cd
package
com
.
paul
.
auth
;
package
com
.
bigsys
.
auth
;
import
com.paul.api.TestService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestParam
;
...
...
@@ -15,14 +13,13 @@ import org.springframework.web.bind.annotation.ResponseBody;
@Controller
public
class
MyController
{
@Autowired
private
TestService
testService
;
@RequestMapping
(
value
=
"/test"
)
@ResponseBody
public
String
testSay
(
@RequestParam
(
value
=
"name"
,
defaultValue
=
""
)
String
name
){
StringBuffer
sb
=
new
StringBuffer
();
sb
.
append
(
"Dubbo: "
).
append
(
testService
.
sayHello
(
name
)
);
sb
.
append
(
"Dubbo: "
).
append
(
""
);
return
sb
.
toString
();
}
...
...
bigsys-auth/src/main/resources/dubbo-config.xml
View file @
1bf305cd
...
...
@@ -16,7 +16,7 @@
<!--dubbo:protocol name="dubbo" port="20880" /-->
<!-- 声明需要暴露的服务接口 -->
<dubbo:reference
interface=
"
com.paul.api.
TestService"
id=
"testService"
check=
"false"
/>
<dubbo:reference
interface=
"TestService"
id=
"testService"
check=
"false"
/>
</beans>
\ No newline at end of file
bigsys-auth/src/main/resources/spring-mvc.xml
View file @
1bf305cd
...
...
@@ -9,7 +9,7 @@
http://www.springframework.org/schema/mvc
http://www.springframework.org/schema/mvc/spring-mvc-3.2.xsd"
>
<context:component-scan
base-package=
"com.
paul
"
/>
<context:component-scan
base-package=
"com.
bigsys
"
/>
<mvc:annotation-driven
/>
...
...
bigsys-dubbo/pom.xml
View file @
1bf305cd
...
...
@@ -2,7 +2,7 @@
xsi:schemaLocation=
"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
>
<parent>
<artifactId>
bigsys
</artifactId>
<groupId>
com.
paul
</groupId>
<groupId>
com.
bigsys
</groupId>
<version>
1.0-SNAPSHOT
</version>
</parent>
<modelVersion>
4.0.0
</modelVersion>
...
...
bigsys-dubbo/src/main/java/com/
paul
/App.java
→
bigsys-dubbo/src/main/java/com/
bigsys/dubbo
/App.java
View file @
1bf305cd
package
com
.
paul
;
package
com
.
bigsys
.
dubbo
;
/**
* Hello world!
...
...
bigsys-
redis/src/test/java/com/paul
/AppTest.java
→
bigsys-
dubbo/src/test/java/com/bigsys
/AppTest.java
View file @
1bf305cd
package
com
.
paul
;
package
com
.
bigsys
;
import
junit.framework.Test
;
import
junit.framework.TestCase
;
...
...
bigsys-redis/pom.xml
View file @
1bf305cd
...
...
@@ -2,7 +2,7 @@
xsi:schemaLocation=
"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
>
<parent>
<artifactId>
bigsys
</artifactId>
<groupId>
com.
paul
</groupId>
<groupId>
com.
bigsys
</groupId>
<version>
1.0-SNAPSHOT
</version>
</parent>
<modelVersion>
4.0.0
</modelVersion>
...
...
bigsys-redis/src/main/java/com/
paul
/App.java
→
bigsys-redis/src/main/java/com/
bigsys/redis
/App.java
View file @
1bf305cd
package
com
.
paul
;
import
com.paul.api.TestService
;
package
com
.
bigsys
.
redis
;
/**
* Hello world!
...
...
bigsys-redis/src/main/java/com/
paul
/api/TestService.java
→
bigsys-redis/src/main/java/com/
bigsys/redis
/api/TestService.java
View file @
1bf305cd
package
com
.
paul
.
api
;
package
com
.
bigsys
.
redis
.
api
;
public
interface
TestService
{
...
...
bigsys-redis/src/main/java/com/
paul
/service/TestServiceImpl.java
→
bigsys-redis/src/main/java/com/
bigsys/redis
/service/TestServiceImpl.java
View file @
1bf305cd
package
com
.
paul
.
service
;
package
com
.
bigsys
.
redis
.
service
;
import
com.
paul
.api.TestService
;
import
com.
bigsys.redis
.api.TestService
;
/**
* Created by fangzhipeng on 2017/8/15.
...
...
bigsys-redis/src/main/resources/applicationContext.xml
View file @
1bf305cd
...
...
@@ -16,8 +16,8 @@
<dubbo:protocol
name=
"dubbo"
port=
"20880"
/>
<!-- 声明需要暴露的服务接口 -->
<dubbo:service
interface=
"com.
paul
.api.TestService"
ref=
"testService"
/>
<dubbo:service
interface=
"com.
bigsys.redis
.api.TestService"
ref=
"testService"
/>
<!-- 具体的实现bean -->
<bean
id=
"testService"
class=
"com.
paul
.service.TestServiceImpl"
/>
<bean
id=
"testService"
class=
"com.
bigsys.redis
.service.TestServiceImpl"
/>
</beans>
\ No newline at end of file
bigsys-
user/src/test/java/com/paul
/AppTest.java
→
bigsys-
redis/src/test/java/com/bigsys
/AppTest.java
View file @
1bf305cd
package
com
.
paul
;
package
com
.
bigsys
;
import
junit.framework.Test
;
import
junit.framework.TestCase
;
...
...
bigsys-shiro/pom.xml
View file @
1bf305cd
...
...
@@ -2,7 +2,7 @@
xsi:schemaLocation=
"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
>
<parent>
<artifactId>
bigsys
</artifactId>
<groupId>
com.
paul
</groupId>
<groupId>
com.
bigsys
</groupId>
<version>
1.0-SNAPSHOT
</version>
</parent>
<modelVersion>
4.0.0
</modelVersion>
...
...
@@ -49,8 +49,8 @@
</dependency>
<dependency>
<groupId>
com.
paul
</groupId>
<artifactId>
spring
</artifactId>
<groupId>
com.
bigsys
</groupId>
<artifactId>
bigsys-
spring
</artifactId>
<version>
1.0-SNAPSHOT
</version>
</dependency>
</dependencies>
...
...
bigsys-
user/src/main/java/com/paul
/App.java
→
bigsys-
shiro/src/main/java/com/bigsys/shiro
/App.java
View file @
1bf305cd
package
com
.
paul
;
package
com
.
bigsys
.
shiro
;
/**
* Hello world!
...
...
bigsys-shiro/src/main/java/com/
paul
/Login.java
→
bigsys-shiro/src/main/java/com/
bigsys/shiro
/Login.java
View file @
1bf305cd
package
com
.
paul
;
package
com
.
bigsys
.
shiro
;
import
org.apache.shiro.SecurityUtils
;
import
org.apache.shiro.authc.AuthenticationToken
;
import
org.apache.shiro.subject.Subject
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.ResponseBody
;
/**
* Created by fangzhipeng on 2017/8/15.
*/
@
RequestMapping
(
value
=
"/login"
)
@
Controller
public
class
Login
{
@RequestMapping
(
value
=
"/login"
)
public
void
login
()
{
@RequestMapping
(
value
=
"/test"
)
@ResponseBody
public
String
login
()
{
// Subject subject = SecurityUtils.getSubject();
// subject.login(new AuthenticationToken() {
// public Object getPrincipal() {
...
...
@@ -23,7 +23,7 @@ public class Login {
// return null;
// }
// });
System
.
out
.
println
(
"登录成功!"
)
;
return
"hello shiro"
;
}
}
bigsys-shiro/src/main/java/com/bigsys/shiro/model/User.java
0 → 100644
View file @
1bf305cd
package
com
.
bigsys
.
shiro
.
model
;
/**
* Created by fangzhipeng on 2017/8/15.
*/
public
class
User
{
private
String
username
;
private
String
password
;
public
String
getUsername
()
{
return
username
;
}
public
void
setUsername
(
String
username
)
{
this
.
username
=
username
;
}
public
String
getPassword
()
{
return
password
;
}
public
void
setPassword
(
String
password
)
{
this
.
password
=
password
;
}
}
bigsys-shiro/src/main/java/com/bigsys/shiro/realm/UserRealm.java
0 → 100644
View file @
1bf305cd
package
com
.
bigsys
.
shiro
.
realm
;
import
com.bigsys.shiro.model.User
;
import
com.bigsys.shiro.service.UserService
;
import
org.apache.shiro.authc.*
;
import
org.apache.shiro.authz.AuthorizationInfo
;
import
org.apache.shiro.authz.SimpleAuthorizationInfo
;
import
org.apache.shiro.realm.AuthorizingRealm
;
import
org.apache.shiro.subject.PrincipalCollection
;
import
javax.annotation.Resource
;
/**
* Created by fangzhipeng on 2017/8/15.
*/
public
class
UserRealm
extends
AuthorizingRealm
{
@Resource
private
UserService
userService
;
protected
AuthorizationInfo
doGetAuthorizationInfo
(
PrincipalCollection
principalCollection
)
{
String
username
=
(
String
)
principalCollection
.
fromRealm
(
getName
()).
iterator
().
next
();
User
user
=
userService
.
getByUsername
(
username
);
if
(
user
!=
null
)
{
SimpleAuthorizationInfo
info
=
new
SimpleAuthorizationInfo
();
info
.
addRole
(
"admin"
);
return
info
;
}
else
{
return
null
;
}
}
protected
AuthenticationInfo
doGetAuthenticationInfo
(
AuthenticationToken
authenticationToken
)
throws
AuthenticationException
{
UsernamePasswordToken
token
=
(
UsernamePasswordToken
)
authenticationToken
;
User
user
=
userService
.
getByUsername
(
token
.
getUsername
());
if
(
user
!=
null
)
{
return
new
SimpleAuthenticationInfo
(
user
.
getUsername
(),
user
.
getPassword
(),
getName
());
}
else
{
return
null
;
}
}
}
bigsys-shiro/src/main/java/com/bigsys/shiro/service/UserService.java
0 → 100644
View file @
1bf305cd
package
com
.
bigsys
.
shiro
.
service
;
import
com.bigsys.shiro.model.User
;
import
org.springframework.stereotype.Service
;
import
javax.annotation.Resource
;
/**
* Created by fangzhipeng on 2017/8/15.
*/
@Service
(
"userService"
)
public
class
UserService
{
public
User
getByUsername
(
String
username
)
{
User
user
=
new
User
();
user
.
setUsername
(
username
);;
user
.
setPassword
(
"123456"
);
return
user
;
}
}
bigsys-shiro/src/main/resources/applicationContext-shiro.xml
deleted
100644 → 0
View file @
6b7eed13
<?xml version="1.0" encoding="UTF-8"?>
<beans
xmlns=
"http://www.springframework.org/schema/beans"
xmlns:context=
"http://www.springframework.org/schema/context"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xmlns:mvc=
"http://www.springframework.org/schema/mvc"
xsi:schemaLocation=
"http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.0.xsd
http://www.springframework.org/schema/mvc
http://www.springframework.org/schema/mvc/spring-mvc-3.2.xsd"
>
<bean
id=
"shiroFilter"
class=
"org.apache.shiro.spring.web.ShiroFilterFactoryBean"
>
<property
name=
"securityManager"
ref=
"securityManager"
/>
<property
name=
"loginUrl"
value=
"/login"
/>
<property
name=
"successUrl"
value=
"/login/loginSuccessFull"
/>
<property
name=
"unauthorizedUrl"
value=
"/login/unauthorized"
/>
<property
name=
"filterChainDefinitions"
>
<value>
/home* = anon
/ = anon
/logout = logout
/role/** = roles[admin]
/permission/** = perms[permssion:look]
/** = authc
</value>
</property>
</bean>
</beans>
\ No newline at end of file
bigsys-shiro/src/main/resources/bigsys-shiro.xml
0 → 100644
View file @
1bf305cd
<?xml version="1.0" encoding="UTF-8"?>
<beans
xmlns=
"http://www.springframework.org/schema/beans"
xmlns:context=
"http://www.springframework.org/schema/context"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xmlns:mvc=
"http://www.springframework.org/schema/mvc"
xsi:schemaLocation=
"http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.0.xsd
http://www.springframework.org/schema/mvc
http://www.springframework.org/schema/mvc/spring-mvc-3.2.xsd"
>
<context:component-scan
base-package=
"com.bigsys.shiro"
></context:component-scan>
<mvc:annotation-driven
/>
<!-- Realm实现 -->
<bean
id=
"userRealm"
class=
"com.bigsys.shiro.realm.UserRealm"
>
</bean>
<!-- 安全管理器 -->
<bean
id=
"securityManager"
class=
"org.apache.shiro.web.mgt.DefaultWebSecurityManager"
>
<property
name=
"realm"
ref=
"userRealm"
/>
</bean>
<bean
id=
"shiroFilter"
class=
"org.apache.shiro.spring.web.ShiroFilterFactoryBean"
>
<property
name=
"securityManager"
ref=
"securityManager"
/>
<property
name=
"loginUrl"
value=
"/login"
/>
<property
name=
"successUrl"
value=
"/login/loginSuccessFull"
/>
<property
name=
"unauthorizedUrl"
value=
"/login/unauthorized"
/>
<property
name=
"filterChainDefinitions"
>
<value>
/home* = anon
/ = anon
/logout = logout
/role/** = roles[admin]
/permission/** = perms[permssion:look]
/** = authc
</value>
</property>
</bean>
</beans>
\ No newline at end of file
bigsys-shiro/src/main/resources/static/login.html
0 → 100644
View file @
1bf305cd
<!DOCTYPE html>
<html
lang=
"en"
>
<head>
<meta
charset=
"UTF-8"
>
<title>
登录页面
</title>
</head>
<body>
<form
action=
"login.html"
>
<label>
用户名:
</label><input
type=
"text"
name=
"username"
>
<label>
密码:
</label><input
type=
"password"
name=
"password"
>
<input
type=
"submit"
name=
"提交"
/>
</form>
</body>
</html>
\ No newline at end of file
bigsys-
dubbo/src/test/java/com/paul
/AppTest.java
→
bigsys-
shiro/src/test/java/com/bigsys
/AppTest.java
View file @
1bf305cd
package
com
.
paul
;
package
com
.
bigsys
;
import
junit.framework.Test
;
import
junit.framework.TestCase
;
...
...
bigsys-spring/pom.xml
View file @
1bf305cd
...
...
@@ -2,12 +2,10 @@
xsi:schemaLocation=
"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
>
<description>
spring 基础依赖
</description>
<author>
fangzhipeng
</author>
<mail>
750411463@qq.com
</mail>
<parent>
<artifactId>
bigsys
</artifactId>
<groupId>
com.
paul
</groupId>
<groupId>
com.
bigsys
</groupId>
<version>
1.0-SNAPSHOT
</version>
</parent>
<modelVersion>
4.0.0
</modelVersion>
...
...
bigsys-s
hiro/src/main/java/com/paul
/App.java
→
bigsys-s
pring/src/main/java/com/bigsys/spring
/App.java
View file @
1bf305cd
package
com
.
paul
;
package
com
.
bigsys
.
spring
;
/**
* Hello world!
...
...
bigsys-user/pom.xml
View file @
1bf305cd
...
...
@@ -2,7 +2,7 @@
xsi:schemaLocation=
"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
>
<parent>
<artifactId>
bigsys
</artifactId>
<groupId>
com.
paul
</groupId>
<groupId>
com.
bigsys
</groupId>
<version>
1.0-SNAPSHOT
</version>
</parent>
<modelVersion>
4.0.0
</modelVersion>
...
...
bigsys-
spring/src/main/java/com/paul
/App.java
→
bigsys-
user/src/main/java/com/bigsys/user
/App.java
View file @
1bf305cd
package
com
.
paul
;
package
com
.
bigsys
.
user
;
/**
* Hello world!
...
...
bigsys-
shiro/src/test/java/com/paul
/AppTest.java
→
bigsys-
user/src/test/java/com/bigsys
/AppTest.java
View file @
1bf305cd
package
com
.
paul
;
package
com
.
bigsys
;
import
junit.framework.Test
;
import
junit.framework.TestCase
;
...
...
bigsys-webdemo/pom.xml
View file @
1bf305cd
...
...
@@ -2,7 +2,7 @@
xsi:schemaLocation=
"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"
>
<parent>
<artifactId>
bigsys
</artifactId>
<groupId>
com.
paul
</groupId>
<groupId>
com.
bigsys
</groupId>
<version>
1.0-SNAPSHOT
</version>
</parent>
<modelVersion>
4.0.0
</modelVersion>
...
...
@@ -14,10 +14,15 @@
<dependencies>
<dependency>
<groupId>
com.
paul
</groupId>
<groupId>
com.
bigsys
</groupId>
<artifactId>
bigsys-spring
</artifactId>
<version>
1.0-SNAPSHOT
</version>
</dependency>
<dependency>
<groupId>
com.bigsys
</groupId>
<artifactId>
bigsys-shiro
</artifactId>
<version>
1.0-SNAPSHOT
</version>
</dependency>
</dependencies>
<build>
<finalName>
bigsys-webdemo
</finalName>
...
...
bigsys-webdemo/src/main/java/com/
paul/
bigsys/webdemo/TestController.java
→
bigsys-webdemo/src/main/java/com/bigsys/webdemo/TestController.java
View file @
1bf305cd
package
com
.
paul
.
bigsys
.
webdemo
;
package
com
.
bigsys
.
webdemo
;
import
org.apache.shiro.web.servlet.ShiroFilter
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.ResponseBody
;
import
javax.annotation.Resource
;
/**
* Created by fangzhipeng on 2017/8/15.
*/
...
...
@@ -13,6 +16,9 @@ public class TestController {
@RequestMapping
(
value
=
"/hello"
)
@ResponseBody
public
String
hello
()
{
System
.
out
.
println
(
"hit"
);
return
"hello world"
;
}
...
...
bigsys-webdemo/src/main/resources/applicationContext.xml
View file @
1bf305cd
<?xml version="1.0" encoding="UTF-8"?>
<beans
xmlns=
"http://www.springframework.org/schema/beans"
xmlns:context=
"http://www.springframework.org/schema/context"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xmlns:mvc=
"http://www.springframework.org/schema/mvc"
xsi:schemaLocation=
"http://www.springframework.org/schema/beans
xmlns:context=
"http://www.springframework.org/schema/context"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xmlns:mvc=
"http://www.springframework.org/schema/mvc"
xsi:schemaLocation=
"http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.0.xsd
http://www.springframework.org/schema/mvc
http://www.springframework.org/schema/mvc/spring-mvc-3.2.xsd"
>
<import
resource=
"spring-mvc.xml"
/>
<import
resource=
"spring-mvc.xml"
/>
<!--<import resource="classpath*:bigsys-shiro.xml"/>-->
</beans>
\ No newline at end of file
bigsys-webdemo/src/main/resources/spring-mvc.xml
View file @
1bf305cd
...
...
@@ -9,8 +9,10 @@
http://www.springframework.org/schema/mvc
http://www.springframework.org/schema/mvc/spring-mvc-3.2.xsd"
>
<context:component-scan
base-package=
"com.
paul
"
/>
<context:component-scan
base-package=
"com.
bigsys.webdemo
"
/>
<mvc:annotation-driven
/>
<mvc:resources
mapping=
"/static/**"
location=
"/,classpath:/static/"
/>
</beans>
\ No newline at end of file
bigsys-webdemo/src/main/webapp/WEB-INF/web.xml
View file @
1bf305cd
...
...
@@ -11,7 +11,10 @@
<servlet-class>
org.springframework.web.servlet.DispatcherServlet
</servlet-class>
<init-param>
<param-name>
contextConfigLocation
</param-name>
<param-value>
classpath:applicationContext.xml
</param-value>
<param-value>
classpath:applicationContext.xml
classpath*:bigsys-*.xml
</param-value>
</init-param>
<load-on-startup>
0
</load-on-startup>
</servlet>
...
...
@@ -20,6 +23,20 @@
<url-pattern>
/
</url-pattern>
</servlet-mapping>
<filter>
<filter-name>
encodingFilter
</filter-name>
<filter-class>
org.springframework.web.filter.CharacterEncodingFilter
</filter-class>
<init-param>
<param-name>
encoding
</param-name>
<param-value>
UTF-8
</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>
encodingFilter
</filter-name>
<url-pattern>
/*
</url-pattern>
</filter-mapping>
</web-app>
pom.xml
View file @
1bf305cd
...
...
@@ -4,7 +4,7 @@
xsi:schemaLocation=
"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
>
<modelVersion>
4.0.0
</modelVersion>
<groupId>
com.
paul
</groupId>
<groupId>
com.
bigsys
</groupId>
<artifactId>
bigsys
</artifactId>
<packaging>
pom
</packaging>
<version>
1.0-SNAPSHOT
</version>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment