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


Java SessionInitListener类代码示例

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


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

示例1: servletInitialized

import com.vaadin.server.SessionInitListener; //导入依赖的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);

		}
	});
}
 
开发者ID:KrishnaPhani,项目名称:KrishnasSpace,代码行数:19,代码来源:CustomVaadinServlet.java

示例2: portletInitialized

import com.vaadin.server.SessionInitListener; //导入依赖的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);
            }
        }
    });
}
 
开发者ID:peholmst,项目名称:vaadin4spring,代码行数:19,代码来源:SpringAwareVaadinPortlet.java

示例3: servletInitialized

import com.vaadin.server.SessionInitListener; //导入依赖的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());
		}
	});
}
 
开发者ID:bsutton,项目名称:scoutmaster,代码行数:20,代码来源:VaadinServlet.java

示例4: servletInitialized

import com.vaadin.server.SessionInitListener; //导入依赖的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;
					}
				}
			});
		}
	});
}
 
开发者ID:amahdy,项目名称:java-pwa,代码行数:41,代码来源:MyUI.java

示例5: servletInitialized

import com.vaadin.server.SessionInitListener; //导入依赖的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);
        }
    });
}
 
开发者ID:tehapo,项目名称:webcam,代码行数:13,代码来源:GifBoothServlet.java

示例6: createServletService

import com.vaadin.server.SessionInitListener; //导入依赖的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;
}
 
开发者ID:peergreen,项目名称:vaadin-osgi,代码行数:12,代码来源:BaseVaadinServlet.java

示例7: servletInitialized

import com.vaadin.server.SessionInitListener; //导入依赖的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);
        }
    });
}
 
开发者ID:mjvesa,项目名称:CloTouch,代码行数:11,代码来源:MyServlet.java

示例8: HolonVaadinServletAutoConfiguration

import com.vaadin.server.SessionInitListener; //导入依赖的package包/类
public HolonVaadinServletAutoConfiguration(ObjectProvider<List<SessionInitListener>> sessionInitListeners,
		ObjectProvider<List<SessionDestroyListener>> sessionDestroyListeners) {
	this.sessionInitListeners = sessionInitListeners.getIfAvailable();
	this.sessionDestroyListeners = sessionDestroyListeners.getIfAvailable();
}
 
开发者ID:holon-platform,项目名称:holon-vaadin,代码行数:6,代码来源:HolonVaadinServletAutoConfiguration.java

示例9: addSessionInitListener

import com.vaadin.server.SessionInitListener; //导入依赖的package包/类
/**
 * Add a {@link SessionInitListener} to be registered at servlet initialization.
 * @param listener The {@link SessionInitListener} to add
 */
public void addSessionInitListener(SessionInitListener listener) {
	if (listener != null) {
		sessionInitListeners.add(listener);
	}
}
 
开发者ID:holon-platform,项目名称:holon-vaadin,代码行数:10,代码来源:HolonVaadinServlet.java


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