Struts2实现文件上传
文件上传成功后结果页面
result.jsp:
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags" %>
<%
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>上传文件后</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">
</head>
<body>
用户名:<s:property value="username"/><br>
密码:<s:property value="password"/><br>
文件:<s:property value="fileName"/>
</body>
</html>
本文介绍了一个使用Struts2框架实现文件上传的例子。在上传成功后,会在结果页面展示用户名、密码及文件名等信息。该示例还包含了设置页面编码、禁用缓存及定义元信息等内容。
977

被折叠的 条评论
为什么被折叠?



