📄 img.jsp
字号:
<%@ page import="cn.com.juneng.system.common.COMMON"%>
<%@ page import="java.io.File"%>
<%@ page import="org.springframework.util.FileCopyUtils"%>
<%
response.setHeader("Pragma","No-cache");
response.setContentType("image/gif");
cn.com.juneng.baseinfo.vo.BaseinfoVOImpl vo = null;
try{
cn.com.juneng.baseinfo.service.BaseinfoService service = (cn.com.juneng.baseinfo.service.BaseinfoService)cn.com.juneng.system.common.SpringBeanFactory.getBean("baseinfoService");
String ryid=request.getParameter("rid");
byte[] xp =null;
if(!COMMON.isEmpty(ryid)){
vo=service.findByPrimaryKey(ryid);
if(!COMMON.isEmpty(vo.getXp())){
xp= vo.getXp();
}else {
File file=new File(request.getRealPath("/")+"no_pic.gif");
java.io.FileInputStream inputstr=new java.io.FileInputStream(file);
java.io.ByteArrayOutputStream bos = new java.io.ByteArrayOutputStream();
int ch;
while((ch=inputstr.read())!=-1) {
bos.write(ch);
}
inputstr.close();
xp = bos.toByteArray();
bos.close();
}
//测试重新写文件
//File againfile=new File("c:/dd.gif");
//FileCopyUtils.copy(xp,againfile);
response.getOutputStream().write(xp);
response.getOutputStream().flush();
}
}catch(Exception e){
e.printStackTrace();
}
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -