當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。