Tomcat跑多项目 修改server.xml
<Context docBase="xyd_xytxw" path="/" reloadable="true" source="org.eclipse.jst.jee.server:xyd_xytxw"/></Host>
JSON格式异常多是因为上下级关系
把BaseConfig.properties.
Host = http://192.168.10.17//shoveeims/
Postfix = .do
FollowStar=http://192.168.10.17/xyd_fans/app/appFollowAdmin.do
adminLg=445544
pwdLg=670b14728ad9902aecba32e22fa4f6bd
Yxshop=http://192.168.10.26:8080//yf/
YxmdKey=1
3扫描code码传值
private boolean downLoadFile(HttpServletResponse response, String filePath) {
FileInputStream fileInputStream = null;
ServletOutputStream os = null;
try{
String fileName = filePath.substring(filePath.lastIndexOf("\\")+1,filePath.length());
fileInputStream = new java.io.FileInputStream(filePath);
response.setCharacterEncoding("UTF-8");
response.setContentType("application/octet-stream");
/防止中文名称乱码
response.setHeader("Content-Disposition","attachment;filename="+new String(fileName.getBytes("gbk"),"iso-8859-1"));
int i;
os = response.getOutputStream();
while ((i = fileInputStream.read()) != -1) {
os.write(i);
}
os.flush();
}catch(Exception e){
e.printStackTrace();
}finally{
try {
fileInputStream.close();
os.close();
} catch (IOException e) {
e.printStackTrace();
}
}
return true;
}