代码
<%@ page contentType="text/html" language="java" errorPage="" pageEncoding="utf-8"%>
<html>
<head>
</head>
<body>
<%
if(request.getParameter("submit1")!=null){
response.setContentType("application/msword;charset=utf-8");
}
%>
平平淡淡才是真
快快乐乐才是福
<form action="" method="post" name="form1">
<input name="submit1" type="submit" id="submit1" value="保存为word">
</form>
</body>
</html>