Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

添加jarslink-springmvc的使用说明,修改springmvc依赖为必需,修改servlet的依赖为test #70

Merged
merged 1 commit into from
Apr 20, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
29 changes: 29 additions & 0 deletions jarslink-springmvc/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# 使用方法
- 在spring mvc的配置文件中定义spring mvc 的jarslink配置
``` xml
<!-- 模块加载引擎 -->
<bean name="moduleLoader" class="com.alipay.jarslink.api.impl.ModuleLoaderImpl"></bean>

<!-- 模块管理器 -->
<bean name="moduleManager" class="com.alipay.jarslink.api.impl.ModuleManagerImpl">
<property name="moduleListenerDispatcher" ref="listenerDispatcher"/>
</bean>

<!-- 模块服务 -->
<bean name="moduleService" class="com.alipay.jarslink.api.impl.ModuleServiceImpl">
<property name="moduleLoader" ref="moduleLoader"></property>
<property name="moduleManager" ref="moduleManager"></property>
</bean>

<!-- 模块监听调度器 -->
<bean id="listenerDispatcher" class="com.alipay.jarslink.api.ModuleListenerDispatcher"/>

<!-- spring mvc RequestMapping 注解jarslink支持 -->
<bean id="moduleHandlerMapping" class="com.alipay.jarslink.support.SpringModuleRequestMappingHandlerMapping">
<property name="moduleListenerDispatcher" ref="listenerDispatcher"/>
</bean>
```
- 其中 moduleLoader、moduleManager、listenerDispatcher 可以定义在主spring配置文件里面而非spring mvc的配置文件中,
- 但是moduleHandlerMapping必需定义在spring mvc的配置文件中。
- 配置好之后即可按照jarslink的加载注册模块的方法进行加载注册有RequestMapping注解的模块进行使用。
- [jarslink的加载注册模块的方法见](https://github.com/alibaba/taitan/wiki/如何使用)
2 changes: 1 addition & 1 deletion jarslink-springmvc/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>${org.springframework.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
Expand All @@ -46,6 +45,7 @@
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>3.0.1</version>
<scope>test</scope>
</dependency>
</dependencies>
</project>