
Struts2
文章平均质量分 85
iteye_11613
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
struts2 Action中cookie的添加、获取、删除
添加cookie cookie phone; phone = new Cookie("userHp", hp); phone.setMaxAge(60 * 60 * 24 * 365); phone.setPath("/"); ServletActionContext.getResponse().addCookie(phone); 获取cookie public String ...原创 2012-10-26 19:00:56 · 899 阅读 · 0 评论 -
struts2与cookie结合实现自动登录
一、本文主要介绍struts2与cookie结合实现自动登录 转:http://blog.youkuaiyun.com/afgasdg/article/details/6642628 struts2与cookie结合时要注意采用.action 动作的方式实现cookie的读取。好了直接看代码: 首先是struts2的配置文件:struts.xml 该配置文件,用户验证成功跳转到success.jsp页...原创 2012-10-26 19:11:02 · 245 阅读 · 0 评论 -
获得客户端真实IP二种方法!
获得客户端真实IP地址的体例一: public String getRemortIP(HttpServletRequest request) { if (request.getHeader("x-forwarded-for") == null) { return request.getRemoteAddr(); } return request.getHeader("x-forwarde...原创 2012-12-07 16:44:24 · 143 阅读 · 0 评论