本文整理了Java中org.sakaiproject.tool.api.Session.removeAttribute()
方法的一些代码示例,展示了Session.removeAttribute()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Session.removeAttribute()
方法的具体详情如下:
包路径:org.sakaiproject.tool.api.Session
类名称:Session
方法名:removeAttribute
[英]Removes the object bound with the specified name from this session. If the session does not have an object bound with the specified name, this method does nothing.
After this method executes, and if the object implements SessionBindingListener
, Sakai calls SessionBindingListener.valueUnbound
.
[中]
代码示例来源:origin: sakaiproject/sakai
@EntityCustomAction(action = "notify", viewKey = "")
public PortalNotifications handleNotify(EntityView view) {
Session s = sessionManager.getCurrentSession();
if ( s == null ) {
throw new IllegalArgumentException("Session not found");
}
List<String> retval = new ArrayList<String> ();
String userWarning = (String) s.getAttribute("userWarning");
if (StringUtils.isNotEmpty(userWarning)) {
retval.add(userWarning);
}
PortalNotifications noti = new PortalNotifications ();
noti.setError(retval);
s.removeAttribute("userWarning");
return noti;
}
代码示例来源:origin: org.sakaiproject.portal/sakai-portal-impl
@EntityCustomAction(action = "notify", viewKey = "")
public PortalNotifications handleNotify(EntityView view) {
Session s = sessionManager.getCurrentSession();
if ( s == null ) {
throw new IllegalArgumentException("Session not found");
}
List<String> retval = new ArrayList<String> ();
String userWarning = (String) s.getAttribute("userWarning");
if (StringUtils.isNotEmpty(userWarning)) {
retval.add(userWarning);
}
PortalNotifications noti = new PortalNotifications ();
noti.setError(retval);
s.removeAttribute("userWarning");
return noti;
}
代码示例来源:origin: org.sakaiproject.kernel/sakai-kernel-impl
/**
* {@inheritDoc}
*/
public void clearUserEffectiveRole(String azGroupId) {
// remove the attribute from the session
sessionManager().getCurrentSession().removeAttribute(ROLESWAP_PREFIX + azGroupId);
resetSecurityCache(azGroupId);
return;
}
代码示例来源:origin: sakaiproject/sakai
public void clearTokenState(String tokenID) {
ToolSession toolSession = sessionmanager.getCurrentToolSession();
if (toolSession == null) {
sessionmanager.getCurrentSession().removeAttribute(tokenID);
} else {
sessionmanager.getCurrentToolSession().removeAttribute(tokenID);
}
}
代码示例来源:origin: uk.org.ponder.sakairsf/sakairsf
public void clearTokenState(String tokenID) {
ToolSession toolSession = sessionmanager.getCurrentToolSession();
if (toolSession == null) {
sessionmanager.getCurrentSession().removeAttribute(tokenID);
}
else {
sessionmanager.getCurrentToolSession().removeAttribute(tokenID);
}
}
代码示例来源:origin: sakaiproject/sakai
public String restoreCurrentUser() {
// switch user session back if it was taken over
Session currentSession = sessionManager.getCurrentSession();
String currentUserId = null;
if (currentSession != null) {
currentUserId = (String) currentSession.getAttribute(CURRENT_USER_MARKER);
if (currentUserId != null) {
currentSession.removeAttribute(CURRENT_USER_MARKER);
currentSession.setUserId(currentUserId);
authzGroupService.refreshUser(currentUserId);
sessionManager.setCurrentSession(currentSession);
}
if ("".equals(currentUserId)) {
currentUserId = null;
}
}
return getUserRefFromUserId(currentUserId);
}
代码示例来源:origin: sakaiproject/sakai
session.removeAttribute(Portal.ATTR_SITE_PAGE + siteId);
代码示例来源:origin: org.sakaiproject.portal/sakai-portal-impl
session.removeAttribute(Portal.ATTR_SITE_PAGE + siteId);
内容来源于网络,如有侵权,请联系作者删除!