Search in sources :

Example 6 with RequestMappingHandlerMapping

use of org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping in project spring-framework by spring-projects.

the class MvcNamespaceTests method testResources.

@Test
public void testResources() throws Exception {
    loadBeanDefinitions("mvc-config-resources.xml", 20);
    HttpRequestHandlerAdapter adapter = appContext.getBean(HttpRequestHandlerAdapter.class);
    assertNotNull(adapter);
    RequestMappingHandlerMapping mapping = appContext.getBean(RequestMappingHandlerMapping.class);
    ContentNegotiationManager manager = mapping.getContentNegotiationManager();
    ResourceHttpRequestHandler handler = appContext.getBean(ResourceHttpRequestHandler.class);
    assertNotNull(handler);
    assertSame(manager, handler.getContentNegotiationManager());
    SimpleUrlHandlerMapping resourceMapping = appContext.getBean(SimpleUrlHandlerMapping.class);
    assertNotNull(resourceMapping);
    assertEquals(Ordered.LOWEST_PRECEDENCE - 1, resourceMapping.getOrder());
    BeanNameUrlHandlerMapping beanNameMapping = appContext.getBean(BeanNameUrlHandlerMapping.class);
    assertNotNull(beanNameMapping);
    assertEquals(2, beanNameMapping.getOrder());
    ResourceUrlProvider urlProvider = appContext.getBean(ResourceUrlProvider.class);
    assertNotNull(urlProvider);
    Map<String, MappedInterceptor> beans = appContext.getBeansOfType(MappedInterceptor.class);
    List<Class<?>> interceptors = beans.values().stream().map(mappedInterceptor -> mappedInterceptor.getInterceptor().getClass()).collect(Collectors.toList());
    assertThat(interceptors, containsInAnyOrder(ConversionServiceExposingInterceptor.class, ResourceUrlProviderExposingInterceptor.class));
    MockHttpServletRequest request = new MockHttpServletRequest();
    request.setRequestURI("/resources/foo.css");
    request.setMethod("GET");
    HandlerExecutionChain chain = resourceMapping.getHandler(request);
    assertNotNull(chain);
    assertTrue(chain.getHandler() instanceof ResourceHttpRequestHandler);
    MockHttpServletResponse response = new MockHttpServletResponse();
    for (HandlerInterceptor interceptor : chain.getInterceptors()) {
        interceptor.preHandle(request, response, chain.getHandler());
    }
    ModelAndView mv = adapter.handle(request, response, chain.getHandler());
    assertNull(mv);
}
Also used : MappedInterceptor(org.springframework.web.servlet.handler.MappedInterceptor) LocaleContextHolder(org.springframework.context.i18n.LocaleContextHolder) Arrays(java.util.Arrays) RequestParam(org.springframework.web.bind.annotation.RequestParam) Validator(org.springframework.validation.Validator) ResourceUrlProvider(org.springframework.web.servlet.resource.ResourceUrlProvider) InvocableHandlerMethod(org.springframework.web.method.support.InvocableHandlerMethod) MockRequestDispatcher(org.springframework.mock.web.test.MockRequestDispatcher) CacheControl(org.springframework.http.CacheControl) NativeWebRequest(org.springframework.web.context.request.NativeWebRequest) ServletWebRequest(org.springframework.web.context.request.ServletWebRequest) HandlerMethod(org.springframework.web.method.HandlerMethod) MvcUriComponentsBuilder(org.springframework.web.servlet.mvc.method.annotation.MvcUriComponentsBuilder) Map(java.util.Map) LocalValidatorFactoryBean(org.springframework.validation.beanvalidation.LocalValidatorFactoryBean) ContentNegotiatingViewResolver(org.springframework.web.servlet.view.ContentNegotiatingViewResolver) SpringBeanPreparerFactory(org.springframework.web.servlet.view.tiles3.SpringBeanPreparerFactory) MappingJackson2XmlHttpMessageConverter(org.springframework.http.converter.xml.MappingJackson2XmlHttpMessageConverter) PathResourceResolver(org.springframework.web.servlet.resource.PathResourceResolver) ResourceTransformer(org.springframework.web.servlet.resource.ResourceTransformer) RequestDispatcher(javax.servlet.RequestDispatcher) NotNull(javax.validation.constraints.NotNull) TypeMismatchException(org.springframework.beans.TypeMismatchException) StandardCharsets(java.nio.charset.StandardCharsets) NumberFormat(org.springframework.format.annotation.NumberFormat) MockServletContext(org.springframework.mock.web.test.MockServletContext) CssLinkResourceTransformer(org.springframework.web.servlet.resource.CssLinkResourceTransformer) ResourceResolver(org.springframework.web.servlet.resource.ResourceResolver) LocaleChangeInterceptor(org.springframework.web.servlet.i18n.LocaleChangeInterceptor) DeferredResultProcessingInterceptor(org.springframework.web.context.request.async.DeferredResultProcessingInterceptor) ScriptTemplateViewResolver(org.springframework.web.servlet.view.script.ScriptTemplateViewResolver) RequestMappingHandlerMapping(org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping) TilesConfigurer(org.springframework.web.servlet.view.tiles3.TilesConfigurer) RequestMappingHandlerAdapter(org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter) Ordered(org.springframework.core.Ordered) Errors(org.springframework.validation.Errors) ResourceUrlProviderExposingInterceptor(org.springframework.web.servlet.resource.ResourceUrlProviderExposingInterceptor) XmlMapper(com.fasterxml.jackson.dataformat.xml.XmlMapper) AbstractJackson2HttpMessageConverter(org.springframework.http.converter.json.AbstractJackson2HttpMessageConverter) BindingResult(org.springframework.validation.BindingResult) FreeMarkerViewResolver(org.springframework.web.servlet.view.freemarker.FreeMarkerViewResolver) CachingResourceResolver(org.springframework.web.servlet.resource.CachingResourceResolver) CacheManager(org.springframework.cache.CacheManager) HandlerInterceptor(org.springframework.web.servlet.HandlerInterceptor) ConversionService(org.springframework.core.convert.ConversionService) Before(org.junit.Before) Validated(org.springframework.validation.annotation.Validated) ViewResolver(org.springframework.web.servlet.ViewResolver) XmlBeanDefinitionReader(org.springframework.beans.factory.xml.XmlBeanDefinitionReader) PathMatcher(org.springframework.util.PathMatcher) ViewResolverComposite(org.springframework.web.servlet.view.ViewResolverComposite) Target(java.lang.annotation.Target) Test(org.junit.Test) WebJarsResourceResolver(org.springframework.web.servlet.resource.WebJarsResourceResolver) BeanNameViewResolver(org.springframework.web.servlet.view.BeanNameViewResolver) GroovyMarkupViewResolver(org.springframework.web.servlet.view.groovy.GroovyMarkupViewResolver) ThemeChangeInterceptor(org.springframework.web.servlet.theme.ThemeChangeInterceptor) FormattingConversionServiceFactoryBean(org.springframework.format.support.FormattingConversionServiceFactoryBean) UrlPathHelper(org.springframework.web.util.UrlPathHelper) GenericWebApplicationContext(org.springframework.web.context.support.GenericWebApplicationContext) Assert(org.junit.Assert) VersionResourceResolver(org.springframework.web.servlet.resource.VersionResourceResolver) Date(java.util.Date) AppCacheManifestTransformer(org.springframework.web.servlet.resource.AppCacheManifestTransformer) HandlerExecutionChain(org.springframework.web.servlet.HandlerExecutionChain) InternalResourceView(org.springframework.web.servlet.view.InternalResourceView) DeserializationFeature(com.fasterxml.jackson.databind.DeserializationFeature) DateTimeFormat(org.springframework.format.annotation.DateTimeFormat) RedirectView(org.springframework.web.servlet.view.RedirectView) Locale(java.util.Locale) SimpleUrlHandlerMapping(org.springframework.web.servlet.handler.SimpleUrlHandlerMapping) Method(java.lang.reflect.Method) UnresolvingLocaleDefinitionsFactory(org.apache.tiles.definition.UnresolvingLocaleDefinitionsFactory) Collection(java.util.Collection) MediaType(org.springframework.http.MediaType) WebApplicationContext(org.springframework.web.context.WebApplicationContext) ISO(org.springframework.format.annotation.DateTimeFormat.ISO) Collectors(java.util.stream.Collectors) ModelAndView(org.springframework.web.servlet.ModelAndView) List(java.util.List) ConcurrentMapCache(org.springframework.cache.concurrent.ConcurrentMapCache) UserRoleAuthorizationInterceptor(org.springframework.web.servlet.handler.UserRoleAuthorizationInterceptor) HttpMessageConverter(org.springframework.http.converter.HttpMessageConverter) ConcurrentTaskExecutor(org.springframework.scheduling.concurrent.ConcurrentTaskExecutor) ConversionServiceExposingInterceptor(org.springframework.web.servlet.handler.ConversionServiceExposingInterceptor) FreeMarkerConfigurer(org.springframework.web.servlet.view.freemarker.FreeMarkerConfigurer) DeferredResultProcessingInterceptorAdapter(org.springframework.web.context.request.async.DeferredResultProcessingInterceptorAdapter) CachingResourceTransformer(org.springframework.web.servlet.resource.CachingResourceTransformer) CallableProcessingInterceptorAdapter(org.springframework.web.context.request.async.CallableProcessingInterceptorAdapter) ContentVersionStrategy(org.springframework.web.servlet.resource.ContentVersionStrategy) GroovyMarkupConfigurer(org.springframework.web.servlet.view.groovy.GroovyMarkupConfigurer) MappedInterceptor(org.springframework.web.servlet.handler.MappedInterceptor) Cache(org.springframework.cache.Cache) ClassPathResource(org.springframework.core.io.ClassPathResource) InternalResourceViewResolver(org.springframework.web.servlet.view.InternalResourceViewResolver) RequestMapping(org.springframework.web.bind.annotation.RequestMapping) DirectFieldAccessor(org.springframework.beans.DirectFieldAccessor) Controller(org.springframework.stereotype.Controller) AbstractHandlerMapping(org.springframework.web.servlet.handler.AbstractHandlerMapping) Retention(java.lang.annotation.Retention) MapperFeature(com.fasterxml.jackson.databind.MapperFeature) DefaultServletHttpRequestHandler(org.springframework.web.servlet.resource.DefaultServletHttpRequestHandler) CompositeUriComponentsContributor(org.springframework.web.method.support.CompositeUriComponentsContributor) ScriptTemplateConfigurer(org.springframework.web.servlet.view.script.ScriptTemplateConfigurer) SimpleControllerHandlerAdapter(org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter) HttpRequestHandlerAdapter(org.springframework.web.servlet.mvc.HttpRequestHandlerAdapter) CallableProcessingInterceptor(org.springframework.web.context.request.async.CallableProcessingInterceptor) MockHttpServletResponse(org.springframework.mock.web.test.MockHttpServletResponse) GzipResourceResolver(org.springframework.web.servlet.resource.GzipResourceResolver) TilesViewResolver(org.springframework.web.servlet.view.tiles3.TilesViewResolver) ObjectMapper(com.fasterxml.jackson.databind.ObjectMapper) Matchers(org.hamcrest.Matchers) CorsConfiguration(org.springframework.web.cors.CorsConfiguration) ParameterizableViewController(org.springframework.web.servlet.mvc.ParameterizableViewController) ElementType(java.lang.annotation.ElementType) TimeUnit(java.util.concurrent.TimeUnit) LocalDate(org.joda.time.LocalDate) ResourceHttpRequestHandler(org.springframework.web.servlet.resource.ResourceHttpRequestHandler) BeanNameUrlHandlerMapping(org.springframework.web.servlet.handler.BeanNameUrlHandlerMapping) ContentNegotiationManager(org.springframework.web.accept.ContentNegotiationManager) FixedVersionStrategy(org.springframework.web.servlet.resource.FixedVersionStrategy) Comparator(java.util.Comparator) Collections(java.util.Collections) RetentionPolicy(java.lang.annotation.RetentionPolicy) MockHttpServletRequest(org.springframework.mock.web.test.MockHttpServletRequest) ResourceHttpRequestHandler(org.springframework.web.servlet.resource.ResourceHttpRequestHandler) HttpRequestHandlerAdapter(org.springframework.web.servlet.mvc.HttpRequestHandlerAdapter) BeanNameUrlHandlerMapping(org.springframework.web.servlet.handler.BeanNameUrlHandlerMapping) HandlerInterceptor(org.springframework.web.servlet.HandlerInterceptor) MockHttpServletRequest(org.springframework.mock.web.test.MockHttpServletRequest) ModelAndView(org.springframework.web.servlet.ModelAndView) SimpleUrlHandlerMapping(org.springframework.web.servlet.handler.SimpleUrlHandlerMapping) ResourceUrlProvider(org.springframework.web.servlet.resource.ResourceUrlProvider) ContentNegotiationManager(org.springframework.web.accept.ContentNegotiationManager) ResourceUrlProviderExposingInterceptor(org.springframework.web.servlet.resource.ResourceUrlProviderExposingInterceptor) ConversionServiceExposingInterceptor(org.springframework.web.servlet.handler.ConversionServiceExposingInterceptor) HandlerExecutionChain(org.springframework.web.servlet.HandlerExecutionChain) RequestMappingHandlerMapping(org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping) MockHttpServletResponse(org.springframework.mock.web.test.MockHttpServletResponse) Test(org.junit.Test)

Example 7 with RequestMappingHandlerMapping

use of org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping in project spring-framework by spring-projects.

the class MvcNamespaceTests method testInterceptors.

@Test
public void testInterceptors() throws Exception {
    loadBeanDefinitions("mvc-config-interceptors.xml", 18);
    RequestMappingHandlerMapping mapping = appContext.getBean(RequestMappingHandlerMapping.class);
    assertNotNull(mapping);
    mapping.setDefaultHandler(handlerMethod);
    MockHttpServletRequest request = new MockHttpServletRequest("GET", "/");
    request.setRequestURI("/accounts/12345");
    request.addParameter("locale", "en");
    request.addParameter("theme", "green");
    HandlerExecutionChain chain = mapping.getHandler(request);
    assertEquals(4, chain.getInterceptors().length);
    assertTrue(chain.getInterceptors()[0] instanceof ConversionServiceExposingInterceptor);
    assertTrue(chain.getInterceptors()[1] instanceof LocaleChangeInterceptor);
    assertTrue(chain.getInterceptors()[2] instanceof ThemeChangeInterceptor);
    assertTrue(chain.getInterceptors()[3] instanceof UserRoleAuthorizationInterceptor);
    request.setRequestURI("/admin/users");
    chain = mapping.getHandler(request);
    assertEquals(2, chain.getInterceptors().length);
    request.setRequestURI("/logged/accounts/12345");
    chain = mapping.getHandler(request);
    assertEquals(3, chain.getInterceptors().length);
    request.setRequestURI("/foo/logged");
    chain = mapping.getHandler(request);
    assertEquals(3, chain.getInterceptors().length);
}
Also used : LocaleChangeInterceptor(org.springframework.web.servlet.i18n.LocaleChangeInterceptor) HandlerExecutionChain(org.springframework.web.servlet.HandlerExecutionChain) ConversionServiceExposingInterceptor(org.springframework.web.servlet.handler.ConversionServiceExposingInterceptor) MockHttpServletRequest(org.springframework.mock.web.test.MockHttpServletRequest) UserRoleAuthorizationInterceptor(org.springframework.web.servlet.handler.UserRoleAuthorizationInterceptor) ThemeChangeInterceptor(org.springframework.web.servlet.theme.ThemeChangeInterceptor) RequestMappingHandlerMapping(org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping) Test(org.junit.Test)

Example 8 with RequestMappingHandlerMapping

use of org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping in project spring-framework by spring-projects.

the class MvcNamespaceTests method testCustomConversionService.

@Test(expected = TypeMismatchException.class)
public void testCustomConversionService() throws Exception {
    loadBeanDefinitions("mvc-config-custom-conversion-service.xml", 14);
    RequestMappingHandlerMapping mapping = appContext.getBean(RequestMappingHandlerMapping.class);
    assertNotNull(mapping);
    mapping.setDefaultHandler(handlerMethod);
    // default web binding initializer behavior test
    MockHttpServletRequest request = new MockHttpServletRequest("GET", "/");
    request.setRequestURI("/accounts/12345");
    request.addParameter("date", "2009-10-31");
    MockHttpServletResponse response = new MockHttpServletResponse();
    HandlerExecutionChain chain = mapping.getHandler(request);
    assertEquals(1, chain.getInterceptors().length);
    assertTrue(chain.getInterceptors()[0] instanceof ConversionServiceExposingInterceptor);
    ConversionServiceExposingInterceptor interceptor = (ConversionServiceExposingInterceptor) chain.getInterceptors()[0];
    interceptor.preHandle(request, response, handler);
    assertSame(appContext.getBean("conversionService"), request.getAttribute(ConversionService.class.getName()));
    RequestMappingHandlerAdapter adapter = appContext.getBean(RequestMappingHandlerAdapter.class);
    assertNotNull(adapter);
    adapter.handle(request, response, handlerMethod);
}
Also used : HandlerExecutionChain(org.springframework.web.servlet.HandlerExecutionChain) ConversionServiceExposingInterceptor(org.springframework.web.servlet.handler.ConversionServiceExposingInterceptor) MockHttpServletRequest(org.springframework.mock.web.test.MockHttpServletRequest) RequestMappingHandlerMapping(org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping) RequestMappingHandlerAdapter(org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter) MockHttpServletResponse(org.springframework.mock.web.test.MockHttpServletResponse) Test(org.junit.Test)

Example 9 with RequestMappingHandlerMapping

use of org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping in project spring-framework by spring-projects.

the class DelegatingWebMvcConfigurationTests method configurePathMatch.

@Test
public void configurePathMatch() throws Exception {
    final PathMatcher pathMatcher = mock(PathMatcher.class);
    final UrlPathHelper pathHelper = mock(UrlPathHelper.class);
    List<WebMvcConfigurer> configurers = new ArrayList<>();
    configurers.add(new WebMvcConfigurerAdapter() {

        @Override
        public void configurePathMatch(PathMatchConfigurer configurer) {
            configurer.setUseRegisteredSuffixPatternMatch(true).setUseTrailingSlashMatch(false).setUrlPathHelper(pathHelper).setPathMatcher(pathMatcher);
        }
    });
    delegatingConfig.setConfigurers(configurers);
    RequestMappingHandlerMapping handlerMapping = delegatingConfig.requestMappingHandlerMapping();
    assertNotNull(handlerMapping);
    assertEquals("PathMatchConfigurer should configure RegisteredSuffixPatternMatch", true, handlerMapping.useRegisteredSuffixPatternMatch());
    assertEquals("PathMatchConfigurer should configure SuffixPatternMatch", true, handlerMapping.useSuffixPatternMatch());
    assertEquals("PathMatchConfigurer should configure TrailingSlashMatch", false, handlerMapping.useTrailingSlashMatch());
    assertEquals("PathMatchConfigurer should configure UrlPathHelper", pathHelper, handlerMapping.getUrlPathHelper());
    assertEquals("PathMatchConfigurer should configure PathMatcher", pathMatcher, handlerMapping.getPathMatcher());
}
Also used : PathMatcher(org.springframework.util.PathMatcher) ArrayList(java.util.ArrayList) UrlPathHelper(org.springframework.web.util.UrlPathHelper) RequestMappingHandlerMapping(org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping) Test(org.junit.Test)

Example 10 with RequestMappingHandlerMapping

use of org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping in project spring-framework by spring-projects.

the class MvcNamespaceTests method testContentNegotiationManager.

@Test
public void testContentNegotiationManager() throws Exception {
    loadBeanDefinitions("mvc-config-content-negotiation-manager.xml", 15);
    RequestMappingHandlerMapping mapping = appContext.getBean(RequestMappingHandlerMapping.class);
    ContentNegotiationManager manager = mapping.getContentNegotiationManager();
    MockHttpServletRequest request = new MockHttpServletRequest("GET", "/foo.xml");
    NativeWebRequest webRequest = new ServletWebRequest(request);
    assertEquals(Collections.singletonList(MediaType.valueOf("application/rss+xml")), manager.resolveMediaTypes(webRequest));
    ViewResolverComposite compositeResolver = this.appContext.getBean(ViewResolverComposite.class);
    assertNotNull(compositeResolver);
    assertEquals("Actual: " + compositeResolver.getViewResolvers(), 1, compositeResolver.getViewResolvers().size());
    ViewResolver resolver = compositeResolver.getViewResolvers().get(0);
    assertEquals(ContentNegotiatingViewResolver.class, resolver.getClass());
    ContentNegotiatingViewResolver cnvr = (ContentNegotiatingViewResolver) resolver;
    assertSame(manager, cnvr.getContentNegotiationManager());
}
Also used : ContentNegotiationManager(org.springframework.web.accept.ContentNegotiationManager) ViewResolverComposite(org.springframework.web.servlet.view.ViewResolverComposite) MockHttpServletRequest(org.springframework.mock.web.test.MockHttpServletRequest) ContentNegotiatingViewResolver(org.springframework.web.servlet.view.ContentNegotiatingViewResolver) RequestMappingHandlerMapping(org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping) NativeWebRequest(org.springframework.web.context.request.NativeWebRequest) ServletWebRequest(org.springframework.web.context.request.ServletWebRequest) ContentNegotiatingViewResolver(org.springframework.web.servlet.view.ContentNegotiatingViewResolver) ScriptTemplateViewResolver(org.springframework.web.servlet.view.script.ScriptTemplateViewResolver) FreeMarkerViewResolver(org.springframework.web.servlet.view.freemarker.FreeMarkerViewResolver) ViewResolver(org.springframework.web.servlet.ViewResolver) BeanNameViewResolver(org.springframework.web.servlet.view.BeanNameViewResolver) GroovyMarkupViewResolver(org.springframework.web.servlet.view.groovy.GroovyMarkupViewResolver) InternalResourceViewResolver(org.springframework.web.servlet.view.InternalResourceViewResolver) TilesViewResolver(org.springframework.web.servlet.view.tiles3.TilesViewResolver) Test(org.junit.Test)

Aggregations

RequestMappingHandlerMapping (org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping)25 Test (org.junit.Test)17 MockHttpServletRequest (org.springframework.mock.web.test.MockHttpServletRequest)13 HandlerExecutionChain (org.springframework.web.servlet.HandlerExecutionChain)11 Bean (org.springframework.context.annotation.Bean)6 ConversionServiceExposingInterceptor (org.springframework.web.servlet.handler.ConversionServiceExposingInterceptor)6 MockHttpServletResponse (org.springframework.mock.web.test.MockHttpServletResponse)5 ContentNegotiationManager (org.springframework.web.accept.ContentNegotiationManager)4 NativeWebRequest (org.springframework.web.context.request.NativeWebRequest)4 ServletWebRequest (org.springframework.web.context.request.ServletWebRequest)4 SimpleUrlHandlerMapping (org.springframework.web.servlet.handler.SimpleUrlHandlerMapping)4 LocaleChangeInterceptor (org.springframework.web.servlet.i18n.LocaleChangeInterceptor)4 RequestMappingHandlerAdapter (org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter)4 ThemeChangeInterceptor (org.springframework.web.servlet.theme.ThemeChangeInterceptor)4 DirectFieldAccessor (org.springframework.beans.DirectFieldAccessor)3 PathMatcher (org.springframework.util.PathMatcher)3 AnnotationConfigWebApplicationContext (org.springframework.web.context.support.AnnotationConfigWebApplicationContext)3 HandlerMethod (org.springframework.web.method.HandlerMethod)3 HandlerInterceptor (org.springframework.web.servlet.HandlerInterceptor)3 UrlPathHelper (org.springframework.web.util.UrlPathHelper)3