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


Java PortletMode.VIEW属性代码示例

本文整理汇总了Java中javax.portlet.PortletMode.VIEW属性的典型用法代码示例。如果您正苦于以下问题:Java PortletMode.VIEW属性的具体用法?Java PortletMode.VIEW怎么用?Java PortletMode.VIEW使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在javax.portlet.PortletMode的用法示例。


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

示例1: standardHandleMethod

@Test
public void standardHandleMethod() throws Exception {
	DispatcherPortlet portlet = new DispatcherPortlet() {
		@Override
		protected ApplicationContext createPortletApplicationContext(ApplicationContext parent) throws BeansException {
			GenericWebApplicationContext wac = new GenericWebApplicationContext();
			wac.registerBeanDefinition("controller", new RootBeanDefinition(MyController.class));
			wac.refresh();
			return wac;
		}
	};
	portlet.init(new MockPortletConfig());

	MockRenderRequest request = new MockRenderRequest(PortletMode.VIEW);
	MockRenderResponse response = new MockRenderResponse();
	portlet.render(request, response);
	assertEquals("test", response.getContentAsString());
}
 
开发者ID:langtianya,项目名称:spring4-understanding,代码行数:18,代码来源:Portlet20AnnotationControllerTests.java

示例2: mavResolver

@Test
public void mavResolver() throws Exception {
	DispatcherPortlet portlet = new DispatcherPortlet() {
		@Override
		protected ApplicationContext createPortletApplicationContext(ApplicationContext parent) throws BeansException {
			GenericWebApplicationContext wac = new GenericWebApplicationContext();
			wac.registerBeanDefinition("controller",
					new RootBeanDefinition(ModelAndViewResolverController.class));
			RootBeanDefinition adapterDef = new RootBeanDefinition(AnnotationMethodHandlerAdapter.class);
			adapterDef.getPropertyValues()
					.add("customModelAndViewResolver", new MyModelAndViewResolver());
			wac.registerBeanDefinition("handlerAdapter", adapterDef);
			wac.refresh();
			return wac;
		}
	};
	portlet.init(new MockPortletConfig());

	MockRenderRequest request = new MockRenderRequest(PortletMode.VIEW);
	MockRenderResponse response = new MockRenderResponse();
	portlet.render(request, response);
}
 
开发者ID:langtianya,项目名称:spring4-understanding,代码行数:22,代码来源:PortletAnnotationControllerTests.java

示例3: testStandardHandleMethod

public void testStandardHandleMethod() throws Exception {
	DispatcherPortlet portlet = new DispatcherPortlet() {
		@Override
		protected ApplicationContext createPortletApplicationContext(ApplicationContext parent) throws BeansException {
			GenericWebApplicationContext wac = new GenericWebApplicationContext();
			wac.registerBeanDefinition("controller", new RootBeanDefinition(MyController.class));
			wac.refresh();
			return wac;
		}
	};
	portlet.init(new MockPortletConfig());

	MockRenderRequest request = new MockRenderRequest(PortletMode.VIEW);
	MockRenderResponse response = new MockRenderResponse();
	portlet.render(request, response);
	assertEquals("test", response.getContentAsString());
}
 
开发者ID:deathspeeder,项目名称:class-guard,代码行数:17,代码来源:PortletAnnotationControllerTests.java

示例4: testMavResolver

public void testMavResolver() throws Exception {
	DispatcherPortlet portlet = new DispatcherPortlet() {
		@Override
		protected ApplicationContext createPortletApplicationContext(ApplicationContext parent) throws BeansException {
			GenericWebApplicationContext wac = new GenericWebApplicationContext();
			wac.registerBeanDefinition("controller",
					new RootBeanDefinition(ModelAndViewResolverController.class));
			RootBeanDefinition adapterDef = new RootBeanDefinition(AnnotationMethodHandlerAdapter.class);
			adapterDef.getPropertyValues()
					.add("customModelAndViewResolver", new MyModelAndViewResolver());
			wac.registerBeanDefinition("handlerAdapter", adapterDef);
			wac.refresh();
			return wac;
		}
	};
	portlet.init(new MockPortletConfig());

	MockRenderRequest request = new MockRenderRequest(PortletMode.VIEW);
	MockRenderResponse response = new MockRenderResponse();
	portlet.render(request, response);
}
 
开发者ID:deathspeeder,项目名称:class-guard,代码行数:21,代码来源:PortletAnnotationControllerTests.java

示例5: invoke1

@Test
public void invoke1() throws Exception {
   meths.reset();
   PortletInvoker i = new PortletInvoker(ams, "portlet1");
   PortletMode mode = PortletMode.VIEW;
   req.setMode(mode);
   i.renderHeaders(req, resp);
   List<String> names = meths.getMethods();
   assertNotNull(names);
   assertEquals(3, names.size());
   List<String> soll = Arrays.asList(new String[] {
         Header1.class.getSimpleName() + "#header1a",
         Header1.class.getSimpleName() + "#header1b",
         Header1.class.getSimpleName() + "#header1c"
         });
   for (String name : names) {
      assertTrue(soll.contains(name));
   }
}
 
开发者ID:apache,项目名称:portals-pluto,代码行数:19,代码来源:InvokeHeaderTest.java

示例6: invoke3b

@Test
public void invoke3b() throws Exception {
   meths.reset();
   PortletInvoker i = new PortletInvoker(ams, "portlet3");
   PortletMode mode = PortletMode.VIEW;
   req.setMode(mode);
   i.renderHeaders(req, resp);
   List<String> names = meths.getMethods();
   assertNotNull(names);
   assertEquals(3, names.size());
   List<String> soll = Arrays.asList(new String[] {
         Header1.class.getSimpleName() + "#header3c",
         Header1.class.getSimpleName() + "#header3a",
         Header1.class.getSimpleName() + "#header3b",
         });
   assertArrayEquals(soll.toArray(), names.toArray());
}
 
开发者ID:apache,项目名称:portals-pluto,代码行数:17,代码来源:InvokeHeaderTest.java

示例7: invoke1

@Test
public void invoke1() throws Exception {
   meths.reset();
   PortletInvoker i = new PortletInvoker(ams, "portlet1");
   PortletMode mode = PortletMode.VIEW;
   req.setMode(mode);
   i.render(req, resp);
   List<String> names = meths.getMethods();
   assertNotNull(names);
   assertEquals(3, names.size());
   List<String> soll = Arrays.asList(new String[] {
         Render1.class.getSimpleName() + "#render1a",
         Render1.class.getSimpleName() + "#render1b",
         Render1.class.getSimpleName() + "#render1c"
         });
   for (String name : names) {
      assertTrue(soll.contains(name));
   }
}
 
开发者ID:apache,项目名称:portals-pluto,代码行数:19,代码来源:InvokeRenderTest.java

示例8: invoke3b

@Test
public void invoke3b() throws Exception {
   meths.reset();
   PortletInvoker i = new PortletInvoker(ams, "portlet3");
   PortletMode mode = PortletMode.VIEW;
   req.setMode(mode);
   i.render(req, resp);
   List<String> names = meths.getMethods();
   assertNotNull(names);
   assertEquals(3, names.size());
   List<String> soll = Arrays.asList(new String[] {
         Render1.class.getSimpleName() + "#render3c",
         Render1.class.getSimpleName() + "#render3a",
         Render1.class.getSimpleName() + "#render3b",
         });
   assertArrayEquals(soll.toArray(), names.toArray());
}
 
开发者ID:apache,项目名称:portals-pluto,代码行数:17,代码来源:InvokeRenderTest.java

示例9: PortletState

public PortletState(String id)
{
	this.id = id;
	portletMode = PortletMode.VIEW;
	windowState = WindowState.NORMAL;
	parameters = new HashMap();
}
 
开发者ID:sakaiproject,项目名称:sakai,代码行数:7,代码来源:PortletState.java

示例10: test1header

@Test
public void test1header() throws Exception {
   String expectedMeth = TestPortlet1.class.getSimpleName() + "#renderHeaders";
   PortletMode pm = PortletMode.VIEW;
   helper.header("Portlet1", pm, expectedMeth);
   assertTrue(meths.isConfigExists());
}
 
开发者ID:apache,项目名称:portals-pluto,代码行数:7,代码来源:PortletInvokeTest.java

示例11: test1render

@Test
public void test1render() throws Exception {
   String expectedMeth = TestPortlet1.class.getSimpleName() + "#render";
   PortletMode pm = PortletMode.VIEW;
   helper.render("Portlet1", pm, expectedMeth);
   assertTrue(meths.isConfigExists());
}
 
开发者ID:apache,项目名称:portals-pluto,代码行数:7,代码来源:PortletInvokeTest.java

示例12: test2render

@Test
public void test2render() throws Exception {
   String expectedMeth = TestPortlet2.class.getSimpleName() + "#myView";
   PortletMode pm = PortletMode.VIEW;
   helper.render("Portlet2", pm, expectedMeth);
   assertFalse(meths.isConfigExists());
}
 
开发者ID:apache,项目名称:portals-pluto,代码行数:7,代码来源:PortletInvokeTest.java

示例13: test3render

@Test
public void test3render() throws Exception {
   String expectedMeth = TestPortlet3.class.getSimpleName() + "#render";
   PortletMode pm = PortletMode.VIEW;
   helper.render("Portlet3", pm, expectedMeth);
   assertTrue(meths.isConfigExists());
}
 
开发者ID:apache,项目名称:portals-pluto,代码行数:7,代码来源:PortletInvokeTest.java

示例14: test1header

@Test
public void test1header() throws Exception {
   String expectedMeth = TestPortlet5.class.getSimpleName() + "#renderHeaders";
   PortletMode pm = PortletMode.VIEW;
   helper.header("Portlet5", pm, expectedMeth);
   assertTrue(meths.isConfigExists());
}
 
开发者ID:apache,项目名称:portals-pluto,代码行数:7,代码来源:AnnotatedGenericPortletInvokeTest.java

示例15: test1render

@Test
public void test1render() throws Exception {
   String expectedMeth = TestPortlet5.class.getSimpleName() + "#render";
   PortletMode pm = PortletMode.VIEW;
   helper.render("Portlet5", pm, expectedMeth);
   assertTrue(meths.isConfigExists());
}
 
开发者ID:apache,项目名称:portals-pluto,代码行数:7,代码来源:AnnotatedGenericPortletInvokeTest.java


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