选择,坚持,勤奋
阅读排行
最新评论
- @土龙:引用来自“董凡东”的评论大神,我用FileZilla上... 查看»
- @董凡东:大神,我用FileZilla上传jdk等为啥在系统目录里面... 查看»
- @Daniel_cs:交叉表用finereport做的话也挺简单的 查看»
- @xialeistudio:不要动 httpd.conf 在 Thinkphp项目目录下新建 ... 查看»
- @Mr_Qi:引用来自“Jieven”的评论java.lang.NoClassDefF... 查看»
- @阿凯乐乐:使用Resource类获取自定义配置兼容性更好,替代原...查看»
- @阿凯乐乐:jdbcUrl=jdbc:mysql://sqld.duapp.com:4050/数据... 查看»
- @土龙:引用来自“虎眼豆丁”的评论 ireport主要做什么用... 查看»
- @Nori:ireport主要做什么用 查看»
- @土龙:引用来自“Chocolee”的评论 List<User> userLis... 查看»
访客统计
- 4
- 22
- 4
- 4
- 33612
1、用户表的ID设置为字符串型,非空,在保存的时候需要给ID赋值。
2、登录时需要从前台获得用户名密码然后去数据库查询是否存在
4、前台使用jstl来判断显示不同的内容
|
1
2
3
|
User user=getModel(User.class);user.set("id", UUID.randomUUID().toString());user.save(); |
|
1
2
3
4
|
String name=getPara("user.name");String password=getPara("user.password");List<User> l=User.dao.find("select * from user where name='" +name+"' and password='"+password+"'"); |
3、保存和移除用户信息到session中
|
1
2
3
4
|
//保存sessiongetSession().setAttribute("username", name);//移除sessiongetSession().removeAttribute("username"); |
|
1
2
3
4
5
6
7
8
|
<c:if test="${sessionScope.username!=null}"> <a href='/user/userInfo.jsp'>欢迎 ${sessionScope.username}</a> <span></span><a href='/user/logout'>注销</a></c:if><c:if test="${sessionScope.username==null}"> <a href='/user/login.jsp'>登录</a> <span></span><a href='/user/register.jsp'>注册</a></c:if> |
jstl只有if没有else,所以用了两个if。分支多的时候可以用下面的标签
|
1
2
3
4
5
6
7
8
9
10
11
|
<c:choose> <c:when test="${condition1}"> condition1为true </c:when> <c:when test="${ condition2}"> condition2为true </c:when> <c:otherwise> condition1和condition2都为false </c:otherwise></c:choose> |
5、servlet api
http://tomcat.apache.org/tomcat-5.5-doc/servletapi/
声明:OSCHINA 博客文章版权属于作者,受法律保护。未经作者同意不得转载。
评论4
-
1楼:Smile月光 Android 发表于 2013-03-12 06:59 回复此评论主要的呢。。。。 -
2楼:土龙 发表于 2013-03-12 09:25 回复此评论不知道你想看什么?我写的jfinal使用笔记主要记录我对jfinal的熟悉过程。关于注册和登录的功能还在做,其他东西我会慢慢补上去。引用来自“panfanglin”的评论
主要的呢。。。。
-
3楼:greatddk 发表于 2013-06-14 14:59 回复此评论'or 'a'='a,登录成功! -
4楼:土龙 发表于 2013-06-14 15:04 回复此评论谢谢提醒,安全问题几乎没有考虑,会尽快补上漏洞。非常感谢。引用来自“greatddk”的评论
'or 'a'='a,登录成功!
关闭相关文章阅读
- 2013/04/18jfinal使用笔记1
- 2013/02/02JFinal笔记(一)
- 2013/02/02JFinal笔记(二)
- 2012/07/02JFinal的ActiveRecord用法 @JFinal...
- 2014/12/15JFinal问题整理

