0
点赞
收藏
分享

微信扫一扫

jsp代码实例第347课

星河出山 2022-02-24 阅读 314

code347.jsp

<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>xxxcode347</title>
</head>
<body>
<p>将当前页面保存为word文档吗?</p>
<form action="" method="get" name="form1">
	<input type="submit" name="submit" value="是">
	<input type="submit" name="submit" value="否">
</form>
<%
	String str1 = request.getParameter("submit");
	if(str1 == null)
	{
		str1 = "";
	}
	if(str1.equals("是"))
	{
		
		//response.setContentType("application/msword;charset=GB2312");
		response.setContentType("application/vnd.ms-works;charset=GB2312");
	}
	if(str1.equals("否"))
	{
		response.sendRedirect("code347.jsp");
	}
%>
</body>
</html>
举报

相关推荐

0 条评论