关于jsp中response.setContentType的问题

1.为什么setcontenttype文件的后缀名仍然是.jsp,比如我设置response.setContentType("text/application/msword")下载后的文件仍然是.jsp不应该是·doc吗?(还有这个帖子怎么把我的代码执行了,下面的学生成绩表不应该是代码吗?
2.代码如下图片说明图片说明图片说明图片说明

```<%@ page language="java" contentType="text/html;charset=gbk"
pageEncoding="utf-8"%>


Insert title here

学生成绩表
学号姓名成绩
124蓝天1
125白云2
126田园3
127荒野4
.html .txt .xls .doc

<%//request.setCharacterEncoding("gbk");
String ctype=request.getParameter("ctype") ;

if(ctype==null){}else if(ctype.equals("text/html")){
response.setContentType(ctype);
}else if(ctype.equals("text/plain")){
response.setContentType(ctype);
}else if(ctype.equals("application/x-msexcel")){
response.setContentType(ctype);
}else if(ctype.equals("application/msword")){
response.setContentType("application/msword;");
}%>

<%@ page language="java" contentType="text/html;charset=gbk"
    pageEncoding="utf-8"%>
<!DOCTYPE html>
<html>
<head>

<title>Insert title here</title>
</head>
<body>
<table border="3">
<caption>学生成绩表</caption>
<tr><th>学号</th><th>姓名</th><th>成绩</th></tr>
<tr><td>124</td><td>蓝天</td><td>1</td></tr>
<tr><td>125</td><td>白云</td><td>2</td></tr>
<tr><td>126</td><td>田园</td><td>3</td></tr>
<tr><td>127</td><td>荒野</td><td>4</td></tr></table>
<form action="" method="post">
<input type="radio" name="ctype" value="text/html">.html
<input type="radio" name="ctype" value="text/plain">.txt
<input type="radio" name="ctype" value="application/x-msexcel">.xls
<input type="radio" name="ctype" value="application/msword">.doc
<input type="submit">
</form>

<%//request.setCharacterEncoding("gbk");
String ctype=request.getParameter("ctype") ;

 if(ctype==null){}else if(ctype.equals("text/html")){
     response.setContentType(ctype);
     }else if(ctype.equals("text/plain")){
               response.setContentType(ctype);
               }else if(ctype.equals("application/x-msexcel")){
               response.setContentType(ctype);
               }else if(ctype.equals("application/msword")){
               response.setContentType("application/msword;");
           }%> 
</body>
</html>

https://www.jb51.net/article/124828.htm