當前位置: 首頁>>代碼示例>>Java>>正文


Java AuthException類代碼示例

本文整理匯總了Java中com.liferay.portal.security.auth.AuthException的典型用法代碼示例。如果您正苦於以下問題:Java AuthException類的具體用法?Java AuthException怎麽用?Java AuthException使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


AuthException類屬於com.liferay.portal.security.auth包,在下文中一共展示了AuthException類的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: tentaAutenticar

import com.liferay.portal.security.auth.AuthException; //導入依賴的package包/類
private boolean tentaAutenticar(ActionRequest request, ActionResponse response, String email, String senha) {
	MethodKey method = new MethodKey("com.liferay.portlet.login.util.LoginUtil", "login", new Class[] { HttpServletRequest.class,
			HttpServletResponse.class, String.class, String.class, boolean.class, String.class });

	try {
		PortalClassInvoker.invoke(false, method, PortalUtil.getHttpServletRequest(request), PortalUtil.getHttpServletResponse(response), email, senha,
				false, CompanyConstants.AUTH_TYPE_EA);
		return true;

	} catch (Exception e) {
		if (e instanceof AuthException) {
			Throwable cause = e.getCause();
			if (cause != null) {
				SessionErrors.add(request, cause.getClass());
				salvarLastPathNaSessao(request);
			} else {
				SessionErrors.add(request, e.getClass());
				salvarLastPathNaSessao(request);
			}
		} else {
			SessionErrors.add(request, e.getClass());
		}
		return false;
	}
}
 
開發者ID:camaradosdeputadosoficial,項目名稱:edemocracia,代碼行數:26,代碼來源:LoginPortlet.java

示例2: tentarAutenticar

import com.liferay.portal.security.auth.AuthException; //導入依賴的package包/類
private boolean tentarAutenticar() {
	MethodKey method = new MethodKey("com.liferay.portlet.login.util.LoginUtil", "login", new Class[] { HttpServletRequest.class,
			HttpServletResponse.class, String.class, String.class, boolean.class, String.class });

	ActionRequest request = (ActionRequest) LiferayFacesContext.getInstance().getPortletRequest();
	ActionResponse response = (ActionResponse) LiferayFacesContext.getInstance().getPortletResponse();
	HttpServletRequest httpServletRequest = getHttpServletRequest(request);

	try {
		PortalClassInvoker.invoke(false, method, httpServletRequest, PortalUtil.getHttpServletResponse(response), email, senha, false,
				CompanyConstants.AUTH_TYPE_EA);

		PortletSession session = request.getPortletSession(false);
		if (session != null)
			session.removeAttribute("email");

		return true;

	} catch (Exception e) {
		if (e instanceof AuthException) {
			Throwable cause = e.getCause();
			if (cause != null)
				SessionErrors.add(request, cause.getClass());
			else
				SessionErrors.add(request, e.getClass());
		} else {
			SessionErrors.add(request, e.getClass());
		}
		return false;
	}
}
 
開發者ID:camaradosdeputadosoficial,項目名稱:edemocracia,代碼行數:32,代碼來源:CadastroBean.java


注:本文中的com.liferay.portal.security.auth.AuthException類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。