当前位置: 首页>>代码示例>>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;未经允许,请勿转载。