当前位置: 首页>>代码示例>>Java>>正文


Java JstlView类代码示例

本文整理汇总了Java中org.springframework.web.servlet.view.JstlView的典型用法代码示例。如果您正苦于以下问题:Java JstlView类的具体用法?Java JstlView怎么用?Java JstlView使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


JstlView类属于org.springframework.web.servlet.view包,在下文中一共展示了JstlView类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: renderView

import org.springframework.web.servlet.view.JstlView; //导入依赖的package包/类
private Map<?, ?> renderView() throws Exception{
    final ModelAndView modelAndView = this.getModelAndViewUponServiceValidationWithSecurePgtUrl();
    final JstlView v = (JstlView) resolver.resolveViewName(modelAndView.getViewName(), Locale.getDefault());
    final MockHttpServletRequest req = new MockHttpServletRequest(new MockServletContext());
    v.setServletContext(req.getServletContext());
    req.setAttribute(RequestContext.WEB_APPLICATION_CONTEXT_ATTRIBUTE,
            new GenericWebApplicationContext(req.getServletContext()));

    final Cas30ResponseView view = new Cas30ResponseView(v);
    view.setServicesManager(this.servicesManager);
    view.setCasAttributeEncoder(new DefaultCasAttributeEncoder(this.servicesManager));

    final MockHttpServletResponse resp = new MockHttpServletResponse();
    view.render(modelAndView.getModel(), req, resp);
    return (Map<?, ?>) req.getAttribute(CasProtocolConstants.VALIDATION_CAS_MODEL_ATTRIBUTE_NAME_ATTRIBUTES);
}
 
开发者ID:hsj-xiaokang,项目名称:springboot-shiro-cas-mybatis,代码行数:17,代码来源:Cas30ResponseViewTests.java

示例2: verifyView

import org.springframework.web.servlet.view.JstlView; //导入依赖的package包/类
@Test
public void verifyView() throws Exception {
    final ModelAndView modelAndView = this.getModelAndViewUponServiceValidationWithSecurePgtUrl();
    final JstlView v = (JstlView) resolver.resolveViewName(modelAndView.getViewName(), Locale.getDefault());
    final MockHttpServletRequest req = new MockHttpServletRequest(new MockServletContext());
    v.setServletContext(req.getServletContext());
    req.setAttribute(RequestContext.WEB_APPLICATION_CONTEXT_ATTRIBUTE,
            new GenericWebApplicationContext(req.getServletContext()));

    final Cas20ResponseView view = new Cas20ResponseView(v);
    final MockHttpServletResponse resp = new MockHttpServletResponse();
    view.render(modelAndView.getModel(), req, resp);

    assertNotNull(req.getAttribute(CasViewConstants.MODEL_ATTRIBUTE_NAME_CHAINED_AUTHENTICATIONS));
    assertNotNull(req.getAttribute(CasViewConstants.MODEL_ATTRIBUTE_NAME_PRIMARY_AUTHENTICATION));
    assertNotNull(req.getAttribute(CasViewConstants.MODEL_ATTRIBUTE_NAME_PRINCIPAL));
    assertNotNull(req.getAttribute(CasProtocolConstants.VALIDATION_CAS_MODEL_PROXY_GRANTING_TICKET_IOU));
}
 
开发者ID:hsj-xiaokang,项目名称:springboot-shiro-cas-mybatis,代码行数:19,代码来源:Cas20ResponseViewTests.java

示例3: contentNegotiatingViewResolver

import org.springframework.web.servlet.view.JstlView; //导入依赖的package包/类
@Bean
public ViewResolver contentNegotiatingViewResolver() {
    logger.debug("Configuring the ContentNegotiatingViewResolver");
    ContentNegotiatingViewResolver viewResolver = new ContentNegotiatingViewResolver();
    List<ViewResolver> viewResolvers = new ArrayList<ViewResolver>();

    UrlBasedViewResolver urlBasedViewResolver = new UrlBasedViewResolver();
    urlBasedViewResolver.setViewClass(JstlView.class);
    urlBasedViewResolver.setSuffix(".html");
    viewResolvers.add(urlBasedViewResolver);

    viewResolver.setViewResolvers(viewResolvers);

    List<View> defaultViews = new ArrayList<View>();
    defaultViews.add(new MappingJackson2JsonView());
    viewResolver.setDefaultViews(defaultViews);

    return viewResolver;
}
 
开发者ID:oncecloud,项目名称:devops-cstack,代码行数:20,代码来源:CloudUnitApplicationContext.java

示例4: setupViewResolver

import org.springframework.web.servlet.view.JstlView; //导入依赖的package包/类
@Bean
public InternalResourceViewResolver setupViewResolver() {
    InternalResourceViewResolver resolver = new InternalResourceViewResolver();
    resolver.setPrefix("/");
    resolver.setSuffix(".jsp");
    resolver.setContentType("text/html; charset-utf-8");
    resolver.setViewClass(JstlView.class);
    return resolver;
}
 
开发者ID:andrsam,项目名称:bookshelf,代码行数:10,代码来源:WebConfig.java

示例5: createView

import org.springframework.web.servlet.view.JstlView; //导入依赖的package包/类
protected JstlView createView(String viewName) {
	return new JstlView("/WEB-INF/jsp/" + viewName + ".jsp") {
		@Override
		protected void renderMergedOutputModel(Map<String, Object> model, HttpServletRequest request, HttpServletResponse response) throws Exception {
			ServletOutputStream output = response.getOutputStream();

			ServletContext servletContext = request.getServletContext();
			super.setServletContext(servletContext);

			CacheResponseWrapper cacheResponseWrapper = new CacheResponseWrapper(response);
			// System.err.println("renderMergedOutputModel");
			super.renderMergedOutputModel(model, request, cacheResponseWrapper);

			byte[] data = cacheResponseWrapper.getResponseData();
			String content = new String(data);
			response(content);

			output.write(data);
			output.flush();
		}
	};
}
 
开发者ID:tanhaichao,项目名称:leopard,代码行数:23,代码来源:FileCacheView.java

示例6: contentNegotiatingViewResolver

import org.springframework.web.servlet.view.JstlView; //导入依赖的package包/类
@Bean
public ViewResolver contentNegotiatingViewResolver() {
    LOGGER.debug("Configuring the ContentNegotiatingViewResolver");
    ContentNegotiatingViewResolver viewResolver = new ContentNegotiatingViewResolver();
    List<ViewResolver> viewResolvers = new ArrayList<>();

    UrlBasedViewResolver urlBasedViewResolver = new UrlBasedViewResolver();
    urlBasedViewResolver.setViewClass(JstlView.class);
    urlBasedViewResolver.setPrefix("/WEB-INF/pages/");
    urlBasedViewResolver.setSuffix(".jsp");
    viewResolvers.add(urlBasedViewResolver);

    viewResolver.setViewResolvers(viewResolvers);

    List<View> defaultViews = new ArrayList<>();
    defaultViews.add(new MappingJackson2JsonView());
    viewResolver.setDefaultViews(defaultViews);

    return viewResolver;
}
 
开发者ID:flowable,项目名称:flowable-engine,代码行数:21,代码来源:DispatcherServletConfiguration.java

示例7: urlBasedViewResolver

import org.springframework.web.servlet.view.JstlView; //导入依赖的package包/类
@Bean
public UrlBasedViewResolver urlBasedViewResolver() {
	UrlBasedViewResolver resolver = new UrlBasedViewResolver();
	resolver.setPrefix("/WEB-INF/views/");
	resolver.setSuffix(".jsp");
	resolver.setViewClass(JstlView.class);
	return resolver;
}
 
开发者ID:Azanx,项目名称:Smart-Shopping,代码行数:9,代码来源:WebMvcConfig.java

示例8: configureViewResolvers

import org.springframework.web.servlet.view.JstlView; //导入依赖的package包/类
/**
    * Configure ViewResolvers to deliver preferred views.
    */
@Override
public void configureViewResolvers(ViewResolverRegistry registry) {

	InternalResourceViewResolver viewResolver = new InternalResourceViewResolver();
	viewResolver.setViewClass(JstlView.class);
	viewResolver.setPrefix("/WEB-INF/views/");
	viewResolver.setSuffix(".jsp");
	registry.viewResolver(viewResolver);
}
 
开发者ID:mustafamym,项目名称:FeedbackCollectionAndMgmtSystem,代码行数:13,代码来源:AppConfig.java

示例9: setupViewResolver

import org.springframework.web.servlet.view.JstlView; //导入依赖的package包/类
@Bean
public UrlBasedViewResolver setupViewResolver() {
    UrlBasedViewResolver resolver = new UrlBasedViewResolver();
    resolver.setPrefix("/WEB-INF/jsp/");
    resolver.setSuffix(".jsp");
    resolver.setViewClass(JstlView.class);
    return resolver;
}
 
开发者ID:marc0tjevp,项目名称:Animal-Kingdom,代码行数:9,代码来源:Config.java

示例10: setupViewResolver

import org.springframework.web.servlet.view.JstlView; //导入依赖的package包/类
/**
 * @return ViewResolver
 */
@Bean
public UrlBasedViewResolver setupViewResolver() {
    final UrlBasedViewResolver resolver = new UrlBasedViewResolver();
    resolver.setPrefix("/");
    resolver.setSuffix(".html");
    resolver.setViewClass(JstlView.class);
    return resolver;
}
 
开发者ID:MinBZK,项目名称:OperatieBRP,代码行数:12,代码来源:WebConfiguratie.java

示例11: viewResolver

import org.springframework.web.servlet.view.JstlView; //导入依赖的package包/类
@Bean
public ViewResolver viewResolver() {
    final InternalResourceViewResolver resolver = new InternalResourceViewResolver();
    resolver.setViewClass(JstlView.class);
    resolver.setPrefix("/WEB-INF/views/");
    resolver.setSuffix(".jsp");
    return resolver;
}
 
开发者ID:cerner,项目名称:jwala,代码行数:9,代码来源:ApacheEnterpriseManagerWebConfig.java

示例12: setupViewResolver

import org.springframework.web.servlet.view.JstlView; //导入依赖的package包/类
@Bean
public InternalResourceViewResolver setupViewResolver() {
    InternalResourceViewResolver resolver = new InternalResourceViewResolver();
    resolver.setViewClass(JstlView.class);
    resolver.setPrefix("/WEB-INF/");
    resolver.setSuffix(".html");
    return resolver;
}
 
开发者ID:kbss-cvut,项目名称:reporting-tool,代码行数:9,代码来源:WebAppConfig.java

示例13: configureViewResolvers

import org.springframework.web.servlet.view.JstlView; //导入依赖的package包/类
@Override
public void configureViewResolvers(ViewResolverRegistry registry) {
    InternalResourceViewResolver viewResolver = new InternalResourceViewResolver();
    viewResolver.setViewClass(JstlView.class);
    viewResolver.setPrefix("/WEB-INF/views/");
    viewResolver.setSuffix(".jsp");
    registry.viewResolver(viewResolver);
}
 
开发者ID:caseydunham,项目名称:hibernate-sandbox,代码行数:9,代码来源:Application.java

示例14: getViewResolver

import org.springframework.web.servlet.view.JstlView; //导入依赖的package包/类
public static InternalResourceViewResolver getViewResolver() {  
    InternalResourceViewResolver viewResolver = new InternalResourceViewResolver();
    viewResolver.setViewClass(JstlView.class);
    viewResolver.setPrefix("/WEB-INF/jsp/");
    viewResolver.setSuffix(".jsp");
    return viewResolver;
}
 
开发者ID:rmap-project,项目名称:rmap,代码行数:8,代码来源:TestUtils.java

示例15: viewResolver

import org.springframework.web.servlet.view.JstlView; //导入依赖的package包/类
@Bean
public ViewResolver viewResolver() {
    final InternalResourceViewResolver resolver = new InternalResourceViewResolver();

    resolver.setViewClass(JstlView.class);
    resolver.setPrefix("/WEB-INF/jsp/");
    resolver.setSuffix(".jsp");

    return resolver;
}
 
开发者ID:suomenriistakeskus,项目名称:oma-riista-web,代码行数:11,代码来源:WebMVCConfig.java


注:本文中的org.springframework.web.servlet.view.JstlView类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。