<%@ page language="java" import="javautil*" pageEncoding="UTF-8"%> <% String path = requestgetContextPath(); String basePath = requestgetScheme()+"://"+requestgetServerName()+":"+requestgetServerPort()+path+"https://www.jb51.net/"; %> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 01 Transitional//EN"> <html> <head> <base href="https://www.jb51.net/<%=basePath%>"> <title>My JSP 'filedemojsp' starting page</title> <meta http-equiv="pragma" content="no-cache"> <meta http-equiv="cache-control" content="no-cache"> <meta http-equiv="expires" content="0"> <meta http-equiv="keywords" content="keyword1,keyword2,keyword3"> <meta http-equiv="description" content="This is my page"> <!-- <link type="text/css" href="https://www.jb51.net/stylescss"> --> </head> <body> 用户名:${requestScopeusename } <br/> 文件:${requestScopefile1 }<br/> ${requestScopefile2 }<br/> <!-- 把上传的图片显示出来 --> <img alt="go" src="https://www.jb51.net/upload/<%=(String)requestgetAttribute("file1")%> " /> </body> </html>
4结果页面: