摘要: //js获取项目根路径,如: http://localhost:8083/uimcardprjfunction getRootPath(){ //获取当前网址,如: http://localhost:8083/uimcardprj/share/meun.jsp var curWwwPat... 阅读全文
posted @ 2014-05-28 10:48 mynotes 阅读(266) 评论(0) 推荐(0) 编辑
摘要: 让其选中 document.getElementById('updateisopen').checked=true;$('#updateisopen',modal).attr("checked", true); //这个方法不好使,属性加上去了,有时页面没效果取消选中$('#updateiswrite',modal).attr("checked", false); 阅读全文
posted @ 2013-11-05 14:47 mynotes 阅读(325) 评论(0) 推荐(0) 编辑
摘要: 给Shiro加入验证码,有多种方式,当然你也可以通过继承修改FormAuthenticationFilter类,通过Shiro去验证验证码。 具体实现请百度:应用Shiro到Web Application(验证码实现) 而今天我要说的,既然使用的SpringMVC,为什么不直接在Controller中就处理验证码验证,让事情变的更简单一点呢?一、新建ValidateCode.java验证码工具类import java.util.Random;import java.awt.image.BufferedImage;import java.awt.Graphics;import java.awt. 阅读全文
posted @ 2013-11-02 13:00 mynotes 阅读(298) 评论(0) 推荐(0) 编辑
摘要: 一、Shiro配置的简要说明。 有心人可能注意到了,在上一章的applicationContext.xml配置文件中,包含以下配置。 /login = anon /validateCode = anon /** = authc View Code 大致解释: 这个就是指定Shiro验证用户登录的类为自定义的ShiroDbRealm.java。在S... 阅读全文
posted @ 2013-11-02 12:57 mynotes 阅读(407) 评论(0) 推荐(0) 编辑
摘要: 授权即访问控制,它将判断用户在应用程序中对资源是否拥有相应的访问权限。如,判断一个用户有查看页面的权限,编辑数据的权限,拥有某一按钮的权限,以及是否拥有打印的权限等等。一、授权的三要素授权有着三个核心元素:权限、角色和用户。权限权限是Apache Shiro安全机制最核心的元素。它在应用程序中明确声明了被允许的行为和表现。一个格式良好好的权限声明可以清晰表达出用户对该资源拥有的权限。大多数的资源会支持典型的CRUD操作(create,read,update,delete),但是任何操作建立在特定的资源上才是有意义的。因此,权限声明的根本思想就是建立在资源以及操作上。而我们通过权限声明仅仅能了解 阅读全文
posted @ 2013-11-02 12:37 mynotes 阅读(6648) 评论(0) 推荐(0) 编辑
摘要: 一、修改ShiroDbRealm类,实现它的doGetAuthorizationInfo方法package org.shiro.demo.service.realm;import java.util.ArrayList;import java.util.List;import javax.annotation.Resource;import org.apache.commons.lang.StringUtils;import org.apache.shiro.authc.AuthenticationException;import org.apache.shiro.authc.Authen.. 阅读全文
posted @ 2013-11-02 12:23 mynotes 阅读(434) 评论(0) 推荐(0) 编辑
摘要: 一、SpringMVC+Apache Shiro+JPA(hibernate)整合配置(1)新建Web工程,且导入所需Jar包。(以下截图为真实项目截图,如有不需要的JAR包,请自行删除) (2)配置web.xml,applicationContext.xml,dispatcher-servlet.xml web.xml hibernateFilter org.springframework.orm.jpa.support.OpenEntityManagerInViewFilter hiber... 阅读全文
posted @ 2013-11-02 11:50 mynotes 阅读(490) 评论(0) 推荐(0) 编辑
摘要: 简介:@RequestMappingRequestMapping是一个用来处理请求地址映射的注解,可用于类或方法上。用于类上,表示类中的所有响应请求的方法都是以该地址作为父路径。RequestMapping注解有六个属性,下面我们把她分成三类进行说明。1、 value, method;value: 指定请求的实际地址,指定的地址可以是URI Template 模式(后面将会说明);method: 指定请求的method类型, GET、POST、PUT、DELETE等;2、 consumes,produces;consumes: 指定处理请求的提交内容类型(Content-Type),例如app 阅读全文
posted @ 2013-11-02 10:07 mynotes 阅读(588) 评论(0) 推荐(0) 编辑
摘要: 以简单的两个类为例:User(int id, String name)Group(int id, String name)没有关联关系时的关系模型:t_user(id intpk, name varchar)t_group(id intpk, name varchar)一、多对一和一对多关联映射(多个用户有相同的组)这几种关联映射后的关系模型是相同的:t_user(id intpk, name varchar,gid intfk->t_group(id))t_group(id intpk, name varchar)1、多对一单向关联实体模型:bean.User(int id, Stri 阅读全文
posted @ 2012-11-07 13:12 mynotes 阅读(165) 评论(0) 推荐(0) 编辑
摘要: var teamList=response.teamList; var svestList=document.getElementById("teamNameList"); for(var i=0;i<teamList.length;i++){ var op = document.createElement("OPTION"); op.value = teamList[i].teamid; op.innerHTML =teamList[i].teamName; svestList.appendChil... 阅读全文
posted @ 2012-09-18 16:00 mynotes 阅读(500) 评论(0) 推荐(0) 编辑