Java
weixin_43470677
这个作者很懒,什么都没留下…
展开
-
request.getScheme() request.getServerName() request.getServerPort() request.getContextPath()
equest.getSchema()可以返回当前页面使用的协议,http 或是 https;request.getServerName()可以返回当前页面所在的服务器的名字;request.getServerPort()可以返回当前页面所在的服务器使用的端口,就是80;request.getContextPath()可以返回当前页面所在的应用的名字;String path = reques...原创 2019-11-29 14:21:40 · 420 阅读 · 0 评论 -
tomcat7不支持version=3.1的修改方法
在所在项目文件.setting下org.eclipse.wst.common.project.facet.core.prefs.xml<?xml version="1.0" encoding="UTF-8"?><faceted-project> <fixed facet="jst.web"/> <fixed facet="wst.jsdt.w...原创 2019-11-25 15:34:16 · 166 阅读 · 0 评论 -
java 将json数组变成字符串
int i;JSONObject j1 = new JSONObject();JSONObject[] jarray=new JSONObject[citylist.size()];JSONArray jSONArray = new JSONArray();for(i=0;i<citylist.size();i++){ jarray[i]=new JSONObject(); j...原创 2019-11-05 09:50:05 · 694 阅读 · 0 评论 -
java servlet 解决中文乱码问题
response.setContentType(“text/html;charset=utf-8”);原创 2019-10-29 15:33:24 · 92 阅读 · 0 评论