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


Java FormAuthenticationFilter.DEFAULT_USERNAME_PARAM属性代码示例

本文整理汇总了Java中org.apache.shiro.web.filter.authc.FormAuthenticationFilter.DEFAULT_USERNAME_PARAM属性的典型用法代码示例。如果您正苦于以下问题:Java FormAuthenticationFilter.DEFAULT_USERNAME_PARAM属性的具体用法?Java FormAuthenticationFilter.DEFAULT_USERNAME_PARAM怎么用?Java FormAuthenticationFilter.DEFAULT_USERNAME_PARAM使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在org.apache.shiro.web.filter.authc.FormAuthenticationFilter的用法示例。


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

示例1: index

@RequestMapping(value = ACTION_INDEX, method = RequestMethod.POST)
public String index(
		@RequestParam(FormAuthenticationFilter.DEFAULT_USERNAME_PARAM) String username,
		Map<String, Object> map, HttpServletRequest request,
		HttpServletResponse response) {
	defaultLocale = request.getLocale();
	Shiro shiro = Shiro.get();
	if (null != shiro && null != username
			&& shiro.getEmail().equals(username)) {
		return REDIRECT + VIEW_WIDGET + VIEW_KETTLE + VIEW_REPOS
				+ ACTION_LIST;
	}
	String message = exception(request);
	map.put("message", message);
	map.put("username", username);
	return PAGE_INDEX;
}
 
开发者ID:jiangzongyao,项目名称:kettle_support_kettle8.0,代码行数:17,代码来源:IndexController.java

示例2: fail

@RequestMapping(value = "/user/login", method = RequestMethod.POST)
public String fail(
		@RequestParam(FormAuthenticationFilter.DEFAULT_USERNAME_PARAM) String userName,
		HttpServletRequest request, Model model) {
	// 用户名
	model.addAttribute(FormAuthenticationFilter.DEFAULT_USERNAME_PARAM,
			userName);
	// 登录失败异常
	model.addAttribute(
			FormAuthenticationFilter.DEFAULT_ERROR_KEY_ATTRIBUTE_NAME,
			request.getAttribute(FormAuthenticationFilter.DEFAULT_ERROR_KEY_ATTRIBUTE_NAME));
	return "login";
}
 
开发者ID:wu560130911,项目名称:MultimediaDesktop,代码行数:13,代码来源:LoginController.java

示例3: fail

/**
 * @Title: fail
 * @Description: TODO(该方法调用前会被Filter拦截,交给shiro验证,如果验证失败会调用该方法)
 * @param @param userName
 * @param @param model
 * @param @return 设定文件
 * @return String 返回类型
 * @throws
 */
@RequestMapping(value = "/login.htm", method = RequestMethod.POST)
public String fail(@RequestParam(FormAuthenticationFilter.DEFAULT_USERNAME_PARAM)
String username,String password, Model model,Member member,HttpServletRequest request) {
    if (null != SecurityUtils.getSubject() && null != SecurityUtils.getSubject().getSession()) {
        SecurityUtils.getSubject().logout();// 进入登录页面,默认把登录用户注销
    }
    model.addAttribute(FormAuthenticationFilter.DEFAULT_USERNAME_PARAM, username);
    member.setMemberName(username);
    member.setMemberPassword(password);
    request.setAttribute("member", member);
    return "login";
}
 
开发者ID:GlacierSoft,项目名称:netloan-project,代码行数:21,代码来源:CommonController.java

示例4: fail

/**
 * @Title: fail
 * @Description: TODO(该方法调用前会被Filter拦截,交给shiro验证,如果验证失败会调用该方法)
 * @param @param userName
 * @param @param model
 * @param @return 设定文件
 * @return String 返回类型
 * @throws
 */
@RequestMapping(value = "/login.htm", method = RequestMethod.POST)
public String fail(@RequestParam(FormAuthenticationFilter.DEFAULT_USERNAME_PARAM)
String userName, Model model) {
    if (null != SecurityUtils.getSubject() && null != SecurityUtils.getSubject().getSession()) {
        SecurityUtils.getSubject().logout();// 进入登录页面,默认把登录用户注销
    }
    model.addAttribute(FormAuthenticationFilter.DEFAULT_USERNAME_PARAM, userName);
    return "login";
}
 
开发者ID:GlacierSoft,项目名称:netloan-project,代码行数:18,代码来源:CommonController.java

示例5: fail

@RequestMapping(method = RequestMethod.POST)
public String fail(@RequestParam(FormAuthenticationFilter.DEFAULT_USERNAME_PARAM) String userName, Model model) {
	model.addAttribute(FormAuthenticationFilter.DEFAULT_USERNAME_PARAM, userName);
	return "account/login";
}
 
开发者ID:XiaoChenYung,项目名称:YCBugsManager,代码行数:5,代码来源:LoginController.java

示例6: fail

@RequestMapping(value = "/login", method = RequestMethod.POST)
public String fail(@RequestParam(FormAuthenticationFilter.DEFAULT_USERNAME_PARAM) String userName, Model model) {
    System.out.println("fail again..");
    model.addAttribute(FormAuthenticationFilter.DEFAULT_USERNAME_PARAM, userName);
    return "account/login";
}
 
开发者ID:fireshort,项目名称:spring-boot-quickstart,代码行数:6,代码来源:LoginController.java

示例7: fail

/**
 * 登陆验证失败跳转
 * 
 * @param userName
 * @param model
 * @return
 */
@RequestMapping(value = "/login", method = RequestMethod.POST)
public String fail(@RequestParam(FormAuthenticationFilter.DEFAULT_USERNAME_PARAM)
String userName, HttpServletRequest req, Model model) {
    String exceptionClassName = (String) req.getAttribute("shiroLoginFailure");
    String error = null;
    if (UnknownAccountException.class.getName().equals(exceptionClassName)) {
        error = "您还没有注册,请注册使用!";
    } else if (IncorrectCredentialsException.class.getName().equals(exceptionClassName)) {
        error = "用户名/密码不正确!";
    } else if (CaptchaInvalidException.class.getName().equals(exceptionClassName)) {
        error = "图形验证码已经失效,请重新刷新页面!";
    } else if (CaptchaException.class.getName().equals(exceptionClassName)) {
        error = "图形验证码错误!";
    } else if (AccountException.class.getName().equals(exceptionClassName)) {
        error = "用户名/密码输入出错!";
    } else if (exceptionClassName != null) {
        error = "登录失败,请重试!";
    }

    if (StringUtils.isEmpty(exceptionClassName)) {
        String code = request.getParameter("captcha");
        String phone = request.getParameter("username");
        String pwd = request.getParameter("password");
        if (StringUtils.equalsIgnoreCase(code, (String) session.getAttribute(ValidateCodeServlet.VALIDATE_CODE))) {
            updateShiroUser(phone, pwd);
            return "redirect:/user/setting";
        } else {
            error = "图形验证码错误!";
        }
    }
    model.addAttribute("errMsg", error);
    // ajax未登入情况
    if (InvokeTypeTools.isAjax(req)) {
        response.setContentType("application/json");
        PrintWriter writer = null;
        try {
            writer = response.getWriter();
        } catch (IOException e1) {
            e1.printStackTrace();
        }
        writer.print(JsonResultUtils.createJsonResult(ResultCode.ERROR, "", error));
        writer.flush();
        writer.close();
    }
    return "account/login";
}
 
开发者ID:wanghuizi,项目名称:fengduo,代码行数:53,代码来源:LoginController.java

示例8: fail

@RequestMapping(value = "/login", method = RequestMethod.POST)
public String fail(@RequestParam(FormAuthenticationFilter.DEFAULT_USERNAME_PARAM) String userName, Model model) {
	model.addAttribute(FormAuthenticationFilter.DEFAULT_USERNAME_PARAM, userName);
	return "login";
}
 
开发者ID:Michaelleolee,项目名称:appengine,代码行数:5,代码来源:LoginController.java


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