cas4.2.7添加新页面说明
controller代码
@Controller
public class ApplicationController extends AbstractController {
@Override
public ModelAndView handleRequestInternal(HttpServletRequest request,
HttpServletResponse response) throws Exception {
return new ModelAndView("application");
}
}
配置WEB-INF/spring-configuration/applicationContext.xml
<bean id="applicationController" class="org.jasig.cas.web.ApplicationController"/>
- 在handlerMappingC中新增映射,
<prop key="/application">applicationController</prop>
,完整代码如下:
<bean id="handlerMappingC" class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping"
p:order="1000"
p:alwaysUseFullPath="true">
<property name="mappings">
<util:properties>
<prop key="/authorizationFailure.html">passThroughController</prop>
<prop key="/statistics/ping">pingController</prop>
<prop key="/statistics/threads">threadsController</prop>
<prop key="/statistics/metrics">metricsController</prop>
<prop key="/statistics/healthcheck">healthController</prop>
<prop key="/captcha.jpg">captchaImageCreateController</prop>
<prop key="/application">applicationController</prop>
</util:properties>
</property>
</bean>
在WEB-INF/spring-configuration下新增view.xml,配置jsp映射路径
<?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:c="http://www.springframework.org/schema/c"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd">
<!-- Application Views -->
<bean id="application" class="org.springframework.web.servlet.view.InternalResourceView"
c:url="/WEB-INF/view-zjs/jsp/default/ui/application.jsp" />
</beans>
web.xml
<servlet-mapping>
<servlet-name>cas</servlet-name>
<url-pattern>/application</url-pattern>
</servlet-mapping>