- 博客(8)
- 收藏
- 关注

原创 javaweb后台request获取项目名,端口号等
通过request获取域名,请求路径,端口号等 HttpServletRequest request = getRequest(); String scheme = request.getScheme();//http String serverName = request.getServerName();//localhost ...
2018-07-26 09:41:36
9561
1
原创 java获取当前的周一到周天
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); Calendar cal = Calendar.getInstance(); cal.setFirstDayOfWeek(Calendar.MONDAY);// 设置一个星期的第一天,按中国的习惯一个星期的第一天是星期一 int dayWeek = cal.get(Calend...
2019-10-10 16:35:16
982
原创 springboot文件上传获取编译后文件的根目录
String classpath = ResourceUtils.getURL("classpath:").getPath();
2019-09-18 15:51:46
1107
原创 javaweb获取当前时间的前一天或者前几天时间
SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); Date date=new Date(); Calendar calendar = Calendar.getInstance(); calendar.setTime(date); cale...
2019-03-14 11:49:44
1509
原创 ajax异步请求
方式一: $.ajax({ async: false, type: "POST", url:'${base}/platform/platform!saveConsult.action', contentType : "application/x-www-form-urlencoded;...
2018-07-30 11:38:46
565
原创 javaweb解决get请求中文乱码问题
在js中对你要传递到后台的中文字段进行URL编码,默认为UTF-8 jsp页面处理方法: var key =xxx; location.href = "${base}/platform/platform!search_List.action?key=" + encodeURI(encodeURI(key)); action处理: String key = getRequest()....
2018-07-25 14:51:32
806
原创 javaweb超链接方式请求下载文件
返回结果设置 @Result(name = "downloadDrive", type = "stream", params = { "contentType", "application/octet-stream;", "contentDisposition", "attachment;filename=${fileName}", "input
2018-07-25 14:43:41
3096
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人