## 配置ctjwebmvc.xml
~~~
<?xml version="1.0" encoding="UTF-8"?>
<ctjwebmvc
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://www.caitaojun.com/ctjwebmvc"
xsi:schemaLocation="http://www.caitaojun.com/ctjwebmvc http://www.caitaojun.com/ctjwebmvc.xsd">
<!-- 是否使用注解开发 -->
<useAnnotation use="true"/>
<!-- 注解所在的包路径 -->
<basepath package="com.caitaojun"/>
<!-- 开启对静态资源的访问 -->
<statusFile suffix=".jsp,.html,.png,.jpg,.js"/>
<!-- 是否集成spring 没有导入ctjwebmvc-sring-plugin就设置为OFF-->
<integratespring switch="OFF"/>
<!-- 视图处理 -->
<views>
<view type="JSP" suffix=".jsp" path="/WEB-INF/pages/" order="1"/>
<view type="HTML" suffix=".html" path="/" order="2"/>
<view type="FREEMARKER" suffix=".ftl" path="/" order="3"/>
</views>
<!-- 常量 可以不用配置 -->
<constants>
<constant key="hello" value="word"/>
</constants>
<!-- 拦截器 可以不用配置-->
<interceptors>
<interceptor order="0" class="com.caitaojun.app.demo1.interceptors.AInterceptor"/>
<interceptor order="1" class="com.caitaojun.app.demo1.interceptors.BInterceptor"/>
<interceptor order="2" class="com.caitaojun.app.demo1.interceptors.CInterceptor"/>
</interceptors>
<!-- action 可以不用配置 用注解开发 -->
<actions>
<action name="sss" class="com.caitaojun.app.demo1.web.controller.Acontroller" method="update">
<reqmethod type="POST"/>
<reqmethod type="GET"/>
<acceptType type="application/json;charset=utf-8"/>
<acceptType type="text/html;charset=utf-8"/>
<produceType type="application/json;charset=utf-8"/>
<produceType type="text/html;charset=utf-8"/>
<param class="javax.servlet.http.HttpServletRequest"/>
<param class="java.util.Map"/>
<result name="re1" type="forward" path="22"/>
<result name="re" type="forward"/>
</action>
<action name="/df" class="com.caitaojun.app.demo1.web.controller.Acontroller" method="df">
<reqmethod type="ANY"/>
<result name="ff" type="file"/>
</action>
<action name="/json" class="com.caitaojun.app.demo1.web.controller.Acontroller" method="json">
<reqmethod type="ANY"/>
<result name="json" type="json"/>
</action>
<action name="/a1" class="com.caitaojun.app.demo1.web.controller.Acontroller" method="a1">
<reqmethod type="ANY"/>
<param class="com.caitaojun.app.demo1.model.User"/>
<result name="a1" type="redirect_view" path="users"/>
</action>
<action name="/a2" class="com.caitaojun.app.demo1.web.controller.Acontroller" method="a2">
<reqmethod type="ANY"/>
<param class="javax.servlet.http.HttpServletRequest"></param>
<param class="com.caitaojun.app.demo1.model.User"/>
<result name="a2" type="json"/>
</action>
</actions>
</ctjwebmvc>
~~~