多图片上传(struts实现)
2009-09-22 00:00:00 来源:WEB开发网next.jsp
<%@ page language="java" import="java.util.*" pageEncoding="ISO-8859-1"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%
String path = request.getContextPath() + "/upload";
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 'next.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>
<c:forEach var="fileName" items="${fileNames}" begin='1'>
<img alt="" width="300" height="200" src="<%=basePath%>${fileName}">
</c:forEach>
</body>
</html>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE struts-config PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 1.1//EN" "http://jakarta.apache.org/struts/dtds/struts-config_1_1.dtd">
<struts-config>
<data-sources />
<form-beans >
<form-bean name="uploadForm" type="com.ninetowns.zhangc.struts.form.UploadForm" />
</form-beans>
<global-exceptions />
<global-forwards />
<action-mappings >
<action
input="new.jsp"
path="/upload" name="uploadForm"
type="com.ninetowns.zhangc.struts.action.UploadAction"
scope="request">
<forward
name="index"
path="/next.jsp"/>
</action>
</action-mappings>
<message-resources parameter="com.ninetowns.zhangc.struts.ApplicationResources" />
</struts-config>
更多精彩
赞助商链接