本文整理汇总了Java中com.vaadin.server.SessionInitEvent类的典型用法代码示例。如果您正苦于以下问题:Java SessionInitEvent类的具体用法?Java SessionInitEvent怎么用?Java SessionInitEvent使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
SessionInitEvent类属于com.vaadin.server包,在下文中一共展示了SessionInitEvent类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: servletInitialized
import com.vaadin.server.SessionInitEvent; //导入依赖的package包/类
@Override
protected void servletInitialized() throws ServletException {
super.servletInitialized();
getService().addSessionInitListener(new SessionInitListener() {
/**
*
*/
private static final long serialVersionUID = -8279023207169735541L;
@Override
public void sessionInit(SessionInitEvent event)
throws ServiceException {
event.getSession().addUIProvider(uiProvider);
}
});
}
示例2: portletInitialized
import com.vaadin.server.SessionInitEvent; //导入依赖的package包/类
@Override
protected void portletInitialized() throws PortletException {
getService().addSessionInitListener(new SessionInitListener() {
private static final long serialVersionUID = -4571879262155039969L;
@Override
public void sessionInit(SessionInitEvent event) throws ServiceException {
try {
ApplicationContext context = PortletApplicationContextUtils
.getRequiredWebApplicationContext(getPortletContext());
SpringAwareUIProvider uiProvider = new SpringAwareUIProvider(context);
event.getSession().addUIProvider(uiProvider);
} catch (IllegalStateException e) {
throw new ServiceException(e);
}
}
});
}
示例3: testOnSessionInit
import com.vaadin.server.SessionInitEvent; //导入依赖的package包/类
@Test
public void testOnSessionInit() throws Exception {
SessionInitEvent event = createMock(SessionInitEvent.class);
// expect adding ui provider
VaadinSession sessionMock = createMock(VaadinSession.class);
expect(event.getSession()).andReturn(sessionMock);
sessionMock.addUIProvider(uiProviderMock);
replayAll();
try {
listener.sessionInit(event);
} finally {
verifyAll();
}
}
示例4: servletInitialized
import com.vaadin.server.SessionInitEvent; //导入依赖的package包/类
@Override
protected void servletInitialized() throws ServletException
{
super.servletInitialized();
getService().addSessionInitListener(new SessionInitListener()
{
/**
*
*/
private static final long serialVersionUID = 1L;
@Override
public void sessionInit(SessionInitEvent event)
{
// event.getSession().addBootstrapListener(new
// BootstrapListener());
}
});
}
示例5: servletInitialized
import com.vaadin.server.SessionInitEvent; //导入依赖的package包/类
@Override
protected void servletInitialized() throws ServletException {
super.servletInitialized();
HeaderTagHandler.init(getService());
getService().addSessionInitListener(new SessionInitListener() {
@Override
public void sessionInit(SessionInitEvent event) throws ServiceException {
event.getSession().addRequestHandler(new RequestHandler() {
@Override
public boolean handleRequest(VaadinSession session, VaadinRequest request,
VaadinResponse response) throws IOException {
String pathInfo = request.getPathInfo();
InputStream in = null;
if (pathInfo.endsWith("sw.js")) {
response.setContentType("application/javascript");
in = getClass().getResourceAsStream("/sw.js");
}
if (in != null) {
OutputStream out = response.getOutputStream();
IOUtils.copy(in, out);
in.close();
out.close();
return true;
} else {
return false;
}
}
});
}
});
}
示例6: servletInitialized
import com.vaadin.server.SessionInitEvent; //导入依赖的package包/类
@Override
protected void servletInitialized() throws ServletException {
super.servletInitialized();
getService().addSessionInitListener(new SessionInitListener() {
@Override
public void sessionInit(SessionInitEvent event)
throws ServiceException {
event.getSession().addBootstrapListener(bootstrapListener);
}
});
}
示例7: createServletService
import com.vaadin.server.SessionInitEvent; //导入依赖的package包/类
@Override
protected VaadinServletService createServletService(DeploymentConfiguration deploymentConfiguration) throws ServiceException {
VaadinServletService servletService = super.createServletService(deploymentConfiguration);
servletService.addSessionInitListener(new SessionInitListener() {
@Override
public void sessionInit(SessionInitEvent sessionInitEvent) throws ServiceException {
sessionInitEvent.getSession().addUIProvider(provider);
}
});
return servletService;
}
示例8: servletInitialized
import com.vaadin.server.SessionInitEvent; //导入依赖的package包/类
@Override
protected void servletInitialized() throws ServletException {
super.servletInitialized();
getService().addSessionInitListener(new SessionInitListener() {
@Override
public void sessionInit(SessionInitEvent event) throws ServiceException {
event.getSession().addUIProvider(uiProvider);
}
});
}
示例9: sessionInit
import com.vaadin.server.SessionInitEvent; //导入依赖的package包/类
@Override
public void sessionInit(SessionInitEvent event) throws ServiceException {
event.getSession().addUIProvider(provider);
}
示例10: sessionInit
import com.vaadin.server.SessionInitEvent; //导入依赖的package包/类
@Override
public void sessionInit(SessionInitEvent event) throws ServiceException {
event.getSession().addUIProvider(uiProvider);
}
示例11: sessionInit
import com.vaadin.server.SessionInitEvent; //导入依赖的package包/类
@Override
public void sessionInit(SessionInitEvent event) throws ServiceException {
// TODO Auto-generated method stub
//System.out.println("Session created");
}
示例12: sessionInit
import com.vaadin.server.SessionInitEvent; //导入依赖的package包/类
@Override
public void sessionInit(SessionInitEvent event) throws ServiceException {
event.getSession().addBootstrapListener(this);
}
示例13: sessionInit
import com.vaadin.server.SessionInitEvent; //导入依赖的package包/类
@Override
public void sessionInit(SessionInitEvent event) throws ServiceException {
}