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


Java Core.initializeSession方法代码示例

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


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

示例1: initializeSessionForUser

import com.mendix.core.Core; //导入方法依赖的package包/类
private static ISession initializeSessionForUser(IContext context, String username) throws CoreException {
	IUser user = Core.getUser(context, username);

	if (user == null) {
		throw new RuntimeException("Assertion: user with username '" + username + "' does not exist");
	}

	return Core.initializeSession(user, null);
}
 
开发者ID:appronto,项目名称:RedisConnector,代码行数:10,代码来源:Misc.java

示例2: createSessionForUser

import com.mendix.core.Core; //导入方法依赖的package包/类
/**
 * Given a username, starts a new session for the user and redirects back to index.html. 
 * If no matching account is found for the user, a new account will be created automatically. 
 * @param resp
 * @param req
 * @param user
 * @return 
 * @throws CoreException
 * @throws IOException 
 * @throws NoSuchMethodException 
 * @throws SecurityException 
 */
static public ISession createSessionForUser(IMxRuntimeResponse resp,
		IMxRuntimeRequest req, IUser user) throws Exception {
	
	LOG.info("User " + user.getName() + " authenticated. Starting session..");
	
	String sessionid = req.getCookie(XAS_SESSION_ID);

	ISession session = Core.initializeSession(user, sessionid);
	
	// Used to enable Single Sign Off request (from remote sso *server*); must only sign off user in a particular User Agent / Browser
	String ua = req.getHeader("User-Agent");
	session.setUserAgent(ua);
	
	if (LOG.isDebugEnabled())
		LOG.debug("Created session, fingerprint: " + OpenIDUtils.getFingerPrint(session));
	
	writeSessionCookies(resp, session);
	
	return session;
}
 
开发者ID:mendix,项目名称:IBM-Watson-Connector-Suite,代码行数:33,代码来源:SessionInitializer.java


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