本文整理汇总了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);
}
});
}
示例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);
}
}
});
}
示例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());
}
});
}
示例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;
}
}
});
}
});
}
示例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);
}
});
}
示例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;
}
示例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);
}
});
}
示例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();
}
示例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);
}
}