<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%> <% String path = request.getContextPath(); String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; %> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <base href="<%=basePath%>"> <title>My JSP 'index.jsp' 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 rel="stylesheet" type="text/css" href="styles.css"> --> </head> <body> <div id="2" style="float:left; margin-top:50px; margin-left:200px "> <form action="FileUpload" method="post" enctype="multipart/form-data" name="uploadform"> <table width="450" cellpadding="4" cellspacing="2" > <tr> <td width="100%" colspan="2"> File:<input name="x" size="40" type="file"> </td> </tr> </table> <br/><br/> <table> <tr><td align="center"><input name="upload" type="submit" class="btn btn-primary" value="UpLoad"/></td></tr> </table> </form> </div> </div> </body> </html>
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%> <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%> <% String path = request.getContextPath(); String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; %> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <base href="<%=basePath%>"> <title>My JSP 'Map.jsp' 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 rel="stylesheet" type="text/css" href="styles.css"> --> </head> <body> <table class="table table-hover table-condensed"> <tr> <td align="center"> <strong>单词</strong> </td> <td align="center"> <strong>数量</strong> </td> </tr> <c:forEach var="map" items="${map}"> <tr> <td> <c:out value="${map.key}" /> </td> <td> <c:out value="${map.value}" /> </td> </tr> </c:forEach> </table> </body> </html>