Tapestry4.1注入HttpRequest
来源:互联网 发布:电脑离线翻译软件 编辑:程序博客网 时间:2024/05/21 14:09
最近在公司的项目后台中需要加入的对用的ip的记录,用户登录后要记录用户ip等相关新防止其他用户拦截到JSESSIONID后,伪造JSESSIONID进行操作。
第一次接触Tapestry基本上没啥概念在网络搜索了相关资料看了IRequestCycle的文档通过IRequestCycle.getInfrastructure() .getRequest()获得的是经过封装的WebRequest无法满足需求
在网上找到的信息是表示需要注入HttpRequest,一头雾水没概念。
看到别人注入使用的是WebRequest
/**注入Request*/
@InjectObject("infrastructure:request")
public abstract WebRequest getRequest();
在问了同事后也使用J5的Annoation代码如下
@InjectObject("service:tapestry.globals.HttpServletRequest")
public abstract HttpServletRequest getServletRequest();
在具体方法中就可以设置ip
this.getVisit().setIpHostKey(
new StringBuilder().append(
getServletRequest().getRemoteAddr())
.append("&").append(
getServletRequest().getRemoteHost())
.toString());
虽说bug解决了但是对Tapestry还是没概念继续看书中,看E的太累了
第一次接触Tapestry基本上没啥概念在网络搜索了相关资料看了IRequestCycle的文档通过IRequestCycle.getInfrastructure() .getRequest()获得的是经过封装的WebRequest无法满足需求
在网上找到的信息是表示需要注入HttpRequest,一头雾水没概念。
看到别人注入使用的是WebRequest
/**注入Request*/
@InjectObject("infrastructure:request")
public abstract WebRequest getRequest();
在问了同事后也使用J5的Annoation代码如下
@InjectObject("service:tapestry.globals.HttpServletRequest")
public abstract HttpServletRequest getServletRequest();
在具体方法中就可以设置ip
this.getVisit().setIpHostKey(
new StringBuilder().append(
getServletRequest().getRemoteAddr())
.append("&").append(
getServletRequest().getRemoteHost())
.toString());
虽说bug解决了但是对Tapestry还是没概念继续看书中,看E的太累了
- Tapestry4.1注入HttpRequest
- Tapestry4常用的注入对象
- Tapestry4常用的注入对象
- HttpRequest
- HttpRequest
- httprequest
- HttpRequest
- HttpRequest
- httpRequest
- Tapestry4的注入(Inject)功能在页面类里的替代实现
- Tapestry4入门
- tapestry4.0新特性
- 菜鸟谈tapestry4.0
- Tapestry4整合Spring
- Tapestry4.0笔记
- Tapestry4集成Oracle InterMedia
- tapestry4.0讨论区
- Tapestry4.1.2入门
- C#中加强ListView控件的功能
- VB数据库方面的知识
- 对Text控件增量赋值的代码优化
- E文积累_20071012
- 总结windows下堆溢出的三种利用方式(1)
- Tapestry4.1注入HttpRequest
- 总结windows下堆溢出的三种利用方式(2)
- 深刻理解SQL Server系统存储过程sp_rename
- 数据执行保护DEP 案例1
- 又是一个星期五
- 服务器也可以DIY
- EasyJWeb的验证系统的Bug及使用心得
- C++ Builder里面保持控件地位置及大小
- 我理解的windows异常处理