<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
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-4.1.xsd
http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-4.1.xsd">
<!-- xml 實現 -->
<!-- name 為path class 為相關處理的java類 -->
<bean name="/user" class="com.bokesoft.yigo.controller.UserController" ></bean>
<!--MultiController 為多方法處理 path /test1/multi?active=方法名 -->
<bean name="/test1/multi" class="com.tgb.web.controller.MultiController">
<property name="methodNameResolver">
<ref bean="paramMethodResolver"/>
</property>
</bean>
<!-- 靜態資源文件配置 -->
<mvc:resources location="/js/" mapping="/js/**">
</mvc:resources>
<bean name="/test1/helloworld" class="com.tgb.web.controller.HelloWorldController" />
<!-- 這個是在一個類中有多方法處理 區分方式為 active=方法名稱 -->
<bean id="paramMethodResolver" class="org.springframework.web.servlet.mvc.multiaction.ParameterMethodNameResolver">
<property name="paramName" value="active">
</property>
</bean>
<!-- 這個是視圖分解器 -->
<bean class="org.springframework.web.servlet.view.InternalResourceViewResolver"
id="internalResourceViewResolver">
<!-- 前綴 -->
<property name="prefix" value="/" />
<!-- 后綴 -->
<property name="suffix" value=".jsp" />
</bean>
</beans>
