Spring mvc中使用request和response
2024-09-29 16:35:28
@ResponseBody
@RequestMapping(value="/ip", method=RequestMethod.GET)
public String getIP(HttpServletRequest request, HttpServletResponse response){
return request.getRemoteAddr();
}
直接在参数中指定,mvc会自动注入
最新文章
- WCF入门教程(五)配置文件
- 基本动画CABasicAnimation - 完成之后闪回初始状态
- 【转】ACM训练计划
- linux_oracle_healthcheck.sh
- webapi 中使用 protobuf
- 在 WinForm 中使用 Direct2D
- 新浪SAE数据库连接demo和说明
- 利用curl并发来提高页面访问速度
- (02)odoo自定义模块
- MongoDB 学习笔记(二)—— MongoDB Shell
- [nowCoder] 子数组最大乘积
- Python 异常处理--raise函数用法
- 【USACO 2.2.3】循环数
- Sort list by merge sort
- 【.net 深呼吸】监听剪贴板更新(针对Vista之后系统)
- Android 导入引用第三方项目
- PHP 实例 AJAX 与 MySQL
- PDF怎么添加文字水印与图片水印
- ftp无法上传问题
- win10安装MongoDB提示 the domain,user name and/or password are incorrect. Remember to use ";."; for the domain if the account is on the local machine.