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


Java WrappedSession.setAttribute方法代码示例

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


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

示例1: processExternalLink

import com.vaadin.server.WrappedSession; //导入方法依赖的package包/类
@Override
public void processExternalLink(VaadinRequest request) {
    WrappedSession wrappedSession = request.getWrappedSession();
    String action = (String) wrappedSession.getAttribute(LAST_REQUEST_ACTION_ATTR);
    if (NexbitLinkHandler.RESET_ACTION.equals(action)) {
        //noinspection unchecked
        Map<String, String> params =
                (Map<String, String>) wrappedSession.getAttribute(LAST_REQUEST_PARAMS_ATTR);
        if (params == null) {
            log.warn("Unable to process the external link: lastRequestParams not found in session");
            return;
        }

        try {
            LinkHandler linkHandler = AppBeans.getPrototype(LinkHandler.NAME, app, action, params);
            if (((NexbitLinkHandler)linkHandler).canHandleLink(action, params)) {
                linkHandler.handle();
                wrappedSession.setAttribute(LAST_REQUEST_ACTION_ATTR, null);
                return;
            }
        } catch (Exception e) {
            error(new com.vaadin.server.ErrorEvent(e));
        }
    }

    super.processExternalLink(request);
}
 
开发者ID:pfurini,项目名称:cuba-component-forgot-password,代码行数:28,代码来源:NexbitAppUI.java

示例2: login

import com.vaadin.server.WrappedSession; //导入方法依赖的package包/类
@Override
public Authentication login(Authentication authentication, boolean rememberMe) throws Exception {
    final HttpServletRequest request = new RememberMeRequestWrapper(getCurrentRequest(), rememberMe,
        getRememberMeParameter());
    final HttpServletResponse response = getCurrentResponse();

    try {
        LOGGER.debug("Attempting authentication of {}, rememberMe = {}", authentication, rememberMe);
        final Authentication fullyAuthenticated = getAuthenticationManager().authenticate(authentication);

        LOGGER.debug("Invoking session authentication strategy");
        sessionAuthenticationStrategy.onAuthentication(fullyAuthenticated, request, response);

        successfulAuthentication(fullyAuthenticated, request, response);
        return fullyAuthenticated;
    } catch (Exception e) {
        unsuccessfulAuthentication(request, response);
        throw e;
    } finally {
        if (saveContextInSessionAfterLogin) {
            LOGGER.debug("Saving security context in the session");
            WrappedSession session = getSession();
            if (session != null) {
                session.setAttribute(springSecurityContextKey, SecurityContextHolder.getContext());
            } else {
                LOGGER.warn(
                    "Tried to save security context in the session, but no session was bound to the current thread");
            }
        }
    }
}
 
开发者ID:peholmst,项目名称:vaadin4spring,代码行数:32,代码来源:DefaultVaadinSharedSecurity.java

示例3: exportAsync

import com.vaadin.server.WrappedSession; //导入方法依赖的package包/类
public void exportAsync(OutputFormat exportMethod, Collection<ReportParameter<?>> params,
		JasperProgressListener progressListener)
{

	if (params == null)
	{
		params = new LinkedList<>();
	}
	this.params = params;

	images = new ConcurrentHashMap<>();

	if (UI.getCurrent() != null)
	{
		WrappedSession session = UI.getCurrent().getSession().getSession();
		session.setAttribute(VaadinJasperPrintServlet.IMAGES_MAP, images);
	}
	else
	{
		logger.warn("No vaadin UI present");
	}

	stop = false;
	writerReady = new CountDownLatch(1);
	completeBarrier = new CountDownLatch(1);
	readerReady = new CountDownLatch(1);
	this.progressListener = progressListener;
	if (progressListener == null)
	{
		this.progressListener = new JasperProgressListener()
		{

			@Override
			public void failed(String string)
			{
				// noop

			}

			@Override
			public void completed()
			{
				// noop

			}

			@Override
			public void outputStreamReady()
			{
				// noop

			}
		};
	}
	inputStream = null;
	outputStream = null;

	queueEntry = new QueueEntry(reportProperties.getReportTitle(), reportProperties.getUsername());
	inQueue = true;
	jobQueue.add(queueEntry);

	this.exportMethod = exportMethod;
	thread = new Thread(this, "JasperManager");
	thread.start();
}
 
开发者ID:rlsutton1,项目名称:VaadinUtils,代码行数:66,代码来源:JasperManager.java


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