jsp程序设计(第2版)耿祥义习题解答-含题目答案

jsp程序设计(第2版)耿祥义习题解答-含题目答案
jsp程序设计(第2版)耿祥义习题解答-含题目答案

习题一

1.怎么启动和关闭Tomcat服务器

答:确保Tomcat服务器使用的是Java_home环境变量设置的JDK。

3.怎样访问Web服务目录子目录中的JSP页面

答:Web服务目录的下的目录称为该Web服务目录下的相对Web服务目录。浏览器的地址栏中键入:http://IP:8080/Web目录名字/子目录名字/JSP页面。

4.如果想修改Tomcat服务器的端口号,应当修改哪个文件?能否将端口号修改为80?

答:修改Tomcat服务器安装目录中conf文件夹中的主配置文件:server.xml,只要没有其他应用程序正在占用80,就可以将端口号设置为80。

习题二

1.“<%!”和“%>”之间声明的变量与“<%”和“%>”之间声明的变量与有何不同

答:“<%!”和“%>”之间声明的变量在整个JSP页面内都有效,称为JSP页面的成员变量,成员变量的有效范围与标记符号<%!、%>所在的位置无关。所有用户共享JSP页面的成员变量,因此任何一个用户对JSP页面成员变量操作的结果,都会影响到其他用户。

“<%”和“%>”之间声明的变量称为局部变量,局部变量在JSP页面后继的所有程序片以及表达式部分内都有效。运行在不同线程中的Java程序片的局部变量互不干扰,即一个用户改变Java 程序片中的局部变量的值不会影响其他用户的Java程序片中的局部变量。当一个线程将Java程序片执行完毕,运行在该线程中的Java程序片的局部变量释放所占的内存。

2.如果有两个用户访问一个JSP页面,该页面中的Java程序片将被执行几次?答:两次。

5.请编写一个简单的JSP页面,显示大写英文字母表。

答:<%@ page contentType="text/html;charset=GB2312" %>

<%

for(char c='A';c<='Z';c++)

{

out.print(" "+c);

}

%>

6.请简单叙述include指令标记和include动作标记的不同。

答:include指令标记的作用是在JSP页面出现该指令的位置处,静态插入一个文件,即JSP页面和插入的文件合并成一个新的JSP页面,然后JSP引擎再将这个新的JSP页面转译成Java文件。因此,插入文件后,必须保证新合并成的JSP页面符合JSP语法规则,即能够成为一个JSP页面文件。include 动作标记告诉JSP页面动态加载一个文件,不把JSP页面中动作指令include所指定的文件与原JSP 页面合并一个新的JSP页面,而是告诉Java解释器,这个文件在JSP运行时(Java文件的字节码文

件被加载执行)才被处理。如果包含的文件是普通的文本文件,就将文件的内容发送到客户端,由客户端负责显示;如果包含的文件是JSP文件,JSP引擎就执行这个文件,然后将执行的结果发送到客户端,并由客户端负责显示这些结果。

7.编写两个JSP页面:main.jsp和lader.jsp,将两个JSP页面保存在同一Web服务目录中。main.jsp 使用include动作标记动态加载lader.jsp页面。lader.jsp页面可以计算并显示梯形的面积。当lader.jsp被加载时获取main.jsp页面中include动作标记的param子标记提供的梯形的上底、下底和高的值。

答:main.jsp:

<%@ page contentType="text/html;charset=GB2312" %>

lader.jsp:

<%@ page contentType="text/html;charset=GB2312" %>

<%

String strA=request.getParameter("a");

String strB=request.getParameter("b");

String strH=request.getParameter("h");

double a=Double.parseDouble(strA);

double b=Double.parseDouble(strB);

double h=Double.parseDouble(strH);

double area=(a+b)*h/2;

%>

梯形面积:<%=area%>

习题三

1.用户可以使用浏览器直接访问一个Tag文件吗?答:不可以

2.Tag文件应当存放在怎样的目录中?

答:如果某个Web服务目录下的JSP页面准备调用一个Tag文件,那么必须在该Web服务目录下,建立目录:Web服务目录\WEB-INF\tags,其中,WEB-INF和tags都是固定的子目录名称,而tags 下的子目录名字可由用户给定。一个Tag文件必须保存到tags目录或其下的子目录中。

3.Tag文件中的tag指令可以设置哪些属性的值?

答:body-content、language、import、pageEncoding 。

4.Tag文件中的attribute指令有怎样的作用?

答:使用attribute指令可以动态地向该Tag文件传递对象的引用。

5.Tag文件中的varibute指令有怎样的作用?

答:使用variable指令可以将Tag文件中的对象返回给调用该Tag文件的JSP页面。

6.编写两个Tag文件Rect.tag和Circle.tag。Rect.tag负责计算并显示矩形的面积,Circle.tag负责计算并显示圆的面积。编写一个JSP页面lianxi6.jsp,该JSP页面使用Tag标记调用Rect.tag 和Circle.tag。调用Rect.tag时,向其传递矩形的两个边的长度;调用Circle.tag时,向其传递圆的半径。

答:Lianxi6.jsp:

<%@ page contentType="text/html;Charset=GB2312" %>

<%@ taglib tagdir="/WEB-INF/tags" prefix="computer"%>

以下是调用Tag文件的效果:

以下是调用Tag文件的效果:

Rect.tag:

这是一个Tag文件,负责计算矩形的面积。

<%@ attribute name="sideA" required="true" %>

<%@ attribute name="sideB" required="true" %>

<%!

public String getArea(double a,double b)

{ if(a>0&&b>0)

{

double area=a*b ;

return "
矩形的面积:"+area;

}

else

{ return("
"+a+","+b+"不能构成一个矩形,无法计算面积");

}

}

%>

<% out.println("
JSP页面传递过来的两条边:"+sideA+","+sideB);

double a=Double.parseDouble(sideA);

double b=Double.parseDouble(sideB);

out.println(getArea(a,b));

%>

Circle.tag:

这是一个Tag文件,负责计算园的面积。

<%@ attribute name="radius" required="true" %>

<%!

public String getArea(double r)

{ if(r>0)

{

double area=Math.PI*r*r ;

return "
圆的面积:"+area;

}

else

{ return("
"+r+"不能构成一个圆,无法计算面积");

}

}

%>

<% out.println("
JSP页面传递过来的半径:"+radius);

double r=Double.parseDouble(radius);

out.println(getArea(r));

%>

7.编写一个Tag文件GetArea.tag负责求出三角形面积,并使用variable指令返回三角形的面积给调用该Tag文件的JSP页面。JSP页面负责显示Tag文件返回的三角形的面积。JSP在调用Tag 文件时,使用attribute指令将三角形三边的长度传递给Tag文件。one.jsp和two.jsp都使用Tag 标记调用GetArea.tag。one.jsp将返回三角形的面积保留最多3位小数、two.jsp将返回的三角形面积保留最多6位小数。

答:one.jsp:

<%@ page contentType="text/html;charset=GB2312" %>

<%@ page import ="java.text.*" %>

<%@ taglib tagdir="/WEB-INF/tags" prefix="computer"%>

面积保留3位小数点:

<%

NumberFormat f=NumberFormat.getInstance();

f.setMaximumFractionDigits(3);

double result=area.doubleValue();

String str=f.format(result);

out.println(str);

%>

two.jsp:

<%@ page contentType="text/html;charset=GB2312" %>

<%@ page import ="java.text.*" %>

<%@ taglib tagdir="/WEB-INF/tags" prefix="computer"%>

面积保留6位小数点:

<%

NumberFormat f=NumberFormat.getInstance();

f.setMaximumFractionDigits(6);

double result=area.doubleValue();

String str=f.format(result);

out.println(str);

%>

GetArea.tag:

<%@ attribute name="sideA" required="true" %>

<%@ attribute name="sideB" required="true" %>

<%@ attribute name="sideC" required="true" %>

<%@ variable name-given="area" variable-class="https://www.360docs.net/doc/aa5685319.html,ng.Double" scope="AT_END" %>

<%

double a=Double.parseDouble(sideA);

double b=Double.parseDouble(sideB);

double c=Double.parseDouble(sideC);

if(a+b>c&&a+c>b&&c+b>a)

{ double p=(a+b+c)/2.0;

double result=Math.sqrt(p*(p-a)*(p-b)*(p-c)) ;

jspContext.setAttribute("area",new Double(result));

}

else

{ jspContext.setAttribute("area",new Double(-1));

}

%>

习题四

2.页面接收汉字信息所做的处理?

答:将获取的字符串用ISO-8859-1进行编码,并将编码存放到一个字节数组中,然后再将这个数组转化为字符串对象。

3.编写两个jsp页面inputString.jsp和computer.jsp,用户可以使用inputstring.jsp提供的表单输入一个字符串,并提交给computer.jsp,该页面通过内置对象获取inputstring.jsp页面提交的字符

串,并显示该字符串的长度。

答:inputString.jsp:

<%@ page contentType="text/html;charset=GB2312" %>

computer.jsp:

<%@ page contentType="text/html;charset=GB2312" %>

<% String textContent=request.getParameter("str");

byte b[]=textContent.getBytes("ISO-8859-1");

textContent=new String(b);

%>

字符串:<%=textContent%>的长度:<%=textContent.length()%>

4.Response调用sendRdirect(URL)方法的作用是什么?答:实现用户的重定向。

习题五

1.File对象能读写文件吗?答:不能

2.File对象怎样获取文件的长度?答:调用public long length()方法。

4. RandomAccessFile类创建的流在读/写文件时有什么特点?

答:RandomAccessFile类既不是输入流类InputStream类的子类,也不是输出流类Outputstream类的子类。想对一个文件进行读写操作时,可以创建一个指向该文件的RandomAccessFile流,这样我们既可以从这个流中读取这个文件的数据,也可以通过这个流给这个文件写入数据。

5. 编写两个JSP页面input.jsp和read.jsp,input.jsp通过表单提交一个目录和该目录下的一个文件名给read.jsp,read.jsp根据input.jsp提交的目录和文件名调用Tag文件Read.jsp读取文件的内容。答:input.jsp:

<%@ page contentType="text/html;charset=GB2312" %>

输入目录:


输入文件名字:

read.jsp:

<%@ page contentType="text/html;charset=GB2312" %>

<%@ taglib tagdir="/WEB-INF/tags" prefix="file"%>

<%

String s1=request.getParameter("dirName");

String s2=request.getParameter("fileName");

if(s1.length()>0&&s2.length()>0)

{

%>


读取的文件内容:


<%

}

%>

Read.tag:

<%@ tag pageEncoding="GB2312" %>

<%@ tag import="java.io.*" %>

<%@ attribute name="dirName" required="true" %>

<%@ attribute name="fileName" required="true" %>

<%@ variable name-given="content" scope="AT_END" %>

<%

StringBuffer str=new StringBuffer();

try{

File f=new File(dirName,fileName);

FileReader in=new FileReader(f);

BufferedReader bufferin=new BufferedReader(in);

String temp;

while((temp=bufferin.readLine())!=null)

{ str.append(temp);

}

bufferin.close();

in.close();

}

catch(IOException e)

str.append(""+e);

}

jspContext.setAttribute("content",new String(str));

%>

习题七

1.设WEB服务目录mymoon中的JSP页面要使用一个bean,该bean的包名为blue.sky。请说明,应当怎样保存bean的字节码。

答:把创建bean的字节码保存到mymoon\WEB-INF\classes\blue\sky中。

2.一个名字为moon的bean,该bean有一个String类型、名字为number的属性。如果创建moon 的java类没有提供public String getNumber()方法,在JSP页面中是否允许使用getProperty标记获取moon的number属性的值。答:不允许。

习题八

1.Servlet对象是在服务器端还是在用户端被创建?答:在服务器端。

2.Servlet对象被创建后将首先调用init方法还是service方法?答:首先调用init方法。

2.假设创建servlet的类是star.flower.Dalian,创建的servlet对象的名字是myservlet,应当怎样配置web.xml文件?答:要在web.xml中添加如下内容:

myservlet

star.flower.Dalian

myservlet

/lookyourServlet

5.如果Servlet类不重写service方法,那么应当重写那两个方法?答:doGet和doPost方法。

6.HttpServletResponse类的sendRedirect方法和RequestDispatcher类的forward方法有何不同?答:HttpServletResponse类的sendRedirect方法可以把用户重新定向到其他页面或servlet,但是不能将用户对当前JSP页面或servlet的请求和响应(HttpServletRequest对象和HttpServletResponse 对象)传递给所重新定向JSP页面或servlet。RequestDispatcher对象使用forward方法可以把用户对当前JSP页面或servle的请求转发给另一个JSP页面或servlet,而且将用户对当前JSP页面或servlet的请求和响应(HttpServletRequest对象和HttpServletResponse对象)传递给所转发的JSP页面或servlet。也就是说,当前页面所要转发的目标页面或servlet对象可以使用request获取用户提交的数据。

7.Servlet对象怎样获得用户的session对象?

答:H ttpServletRequest对象request调用getSession方法获取用户的session对象

新视野大学英语第二册(第二版)课后翻译原题与答案

01. 她连水都不愿喝一口,更别提留下来吃饭了。 She wouldn't take a drink, much less would she stay for dinner. 02. 他认为我在对他说谎,但实际上我讲的是实话。 He thought I was lying to him, whereas I was telling the truth. 03. 这个星期你每天都迟到,对此你怎么解释? How do you account for the fact that you have been late every day this week? 04. 他们利润增长,部分原因是采用了新的市场策略。 The increase in their profits is due partly to their new market strategy. 05. 这样的措施很可能会带来工作效率的提高。 Such measures are likely to result in the improvement of work efficiency. 06. 我们已经在这个项目上投入了大量时间和精力,所以我们只能继续。 We have already poured a lot of time and energy into the project, so we have to carry on. 07. 尽管她是家里的独生女,她父母也从不溺爱她。 Despite the fact that she is the only child in her family, she is never babied by her parents. 08. 迈克没来参加昨晚的聚会,也没给我打电话作任何解释。 Mike didn't come to the party last night, nor did he call me to give an explanation. 09. 坐在他旁边的那个人确实发表过一些小说,但决不是什么大作家。 The person sitting next to him did publish some novels, but he is by no means a great writer. 10. 他对足球不感兴趣,也从不关心谁输谁赢。 He has no interest in football and is indifferent to who wins or loses. 11. 经理需要一个可以信赖的助手,在他外出时,由助手负责处理问题。 The manager needs an assistant that he can count on to take care of problems in his absence. 12. 这是他第一次当着那么多观众演讲。 This is the first time that he has made a speech in the presence of so large an audience. 13. 你再怎么有经验,也得学习新技术。 You are never too experienced to learn new techniques. 14. 还存在一个问题,那就是派谁去带领那里的研究工作。(Use an appositional structure.) There remains one problem, namely, who should be sent to head the research there. 15. 由于文化的不同,他们的关系在开始确实遇到了一些困难。 Their relationship did meet with some difficulty at the beginning because of cultural differences. 16. 虽然他历经沉浮,但我始终相信他总有一天会成功的。 Though he has had ups and downs, I believed all along that he would succeed someday. 17. 我对你的说法的真实性有些保留看法。 I have some reservations about the truth of your claim. 18. 她长得并不特别高,但是她身材瘦,给人一种个子高的错觉。 She isn't particularly tall, but her slim figure gives an illusion of height. 19. 有朋自远方来,不亦乐乎?(Use "it" as the formal subject.) It is a great pleasure to meet friends from afar. 20. 不管黑猫白猫,能抓住老鼠就是好猫。(as long as) It doesn't matter whether the cat is black or white as long as it catches mice. 21. 你必须明天上午十点之前把那笔钱还给我。 You must let me have the money back without fail by ten o'clock tomorrow morning. 22. 请允许我参加这个项目,我对这个项目非常感兴趣。 Allow me to take part in this project: I am more than a little interested in it. 23. 人人都知道他比较特殊:他来去随意。(be free to do sth.) Everyone knows that he is special: He is free to come and go as he pleases. 24. 看她脸上不悦的神色,我似乎觉得她有什么话想跟我说。 Watching the unhappy look on her face, I felt as though she wished to say something to me. 25. 他说话很自信,给我留下了很深的印象。(Use "which" to refer back to an idea or situation.)

实用综合教程(第二版)课后练习答案

1、Don 'tlet the failure discourag y e ou.Try again. 2、He dropped out of college after only two weeks. 3、He spoke very highly of her. 4、Peter took advantage of his visit to London to improve his English. 5、The chairman agreed to conside r my suggestion. 6、The idea needs to be tried out. 7、The new road is a major government project. 8、This is our greatest and most encouraging progress; in short,a triumph. 9、The house has belonged to our family for a long time. 10、There was a pause in the talk when Mary came in. 11、We all look forward to your next visit to Nanjing. 12、She discovered that she had lost her purse. 13、The plane will land in five minutes. 14、It used to be thought that the earth was flat. 15、Everyone is fascinated by the singer 's amazing voice. 16、My parents are thinking of spending their holiday in France. 17、She's very modes t about her success. 18、Most plants require sunlight. 19、Be careful to your words when talking to elderly people. 20、Mother called again to make certain that the new air-conditioner would be delivered the next day. 21、I presented a bunch of flowers to Mrs.Link last Christmas. 22、Jack wrapped the gift in a piece of colored paper. 23、Shall I make the introduction?Robert,this is Julia. 24、My mom cleans the house every day and keeps everything in order. 25、This idea appeared in many books. 26、The People's Republic of China was founded in 1949. 27、When will the work on the highway be completed? 28、Oranges are my favorite fruit. 29、Hans Andersen created many lovely characters. 30、The business has expanded from having one office to having twelve. 31、Did you have fun at Disneyland last summer? 32、His lies brought to an end his friendship with Mike. 33、I'll help you as far as I can. 34、He had included a large number of funny stories in the speech. 35、These greenbelts protect 500,000 acres of farmland against moving sands. 36、The TV program is shown to call people's attention to water pollution in China. 37、 A soft wind caused ripples on the surface of the lake. 38、The children formed a circle around her. 39、My mother measured me for a new dress. 40、The park lies at the center of the city. 41、The train would pull out soon. We ran like mad to catch it. 42、My old grandmother has difficulty in remembering things. 43、The company employed about 100 men. 44、She checked the letter before sending it.

Jsp程序设计复习试题

《JSP 程序设计》复习题 一、 选择题 HTML 页面中加入( D )就构成了一个 JSP 页面文件。 A 、JAVA 程序片 B 、JSP 标签 C 、用“<%”、“%>”标记符号括起来的程序 2. 配置 JSP 运行环境,若 WEB 应用服务器选用 TOMCAT ,以下说法正确的是: ( A 、先安装 TOMCAT ,再安装 JDK ,再安装 TOMCAT B 、不需安装 JDK ,安装 TOMCAT 就可以了 C 、JDK 和 TOMCAT 只要都安装就可以了,安装顺序没关系 B ) 3. 对于“<%!”、“%>”之间声明的变量,以下说法正确的是:( B ) A 、不是 JSP 页面的成员变量 、多个用户同时访问该页面时,任何一个用户对这些变量的操作,都会影响到其他用 C 、多个用户同时访问该页面时,每个用户对这些变量的操作都是互相独立的,不会互 相影响 D 、是 JSP 页面的局部变量 4. 在客户端浏览器的源代码中可以看到( B A 、JSP 注释 C 、JSP 注释和 HTML 注释 D 、JAVA 注释 5. page 指令的作用是:( A ) JSP 页面的一些属性和这些属性的值 A 、用来在 JSP 页面内某处嵌入一个文件 B 、使该 JSP 页面动态包含一个文件 C 、指示 JSP 页面加载 Java plugin 6. page 指令的 import 属性的作用是( C A 、定义 JSP 页面响应的 MIME 类型 B 、 D 、定义 JSP 页面字符的编码 ) 7. ( C )可在 JSP 页面出现该指令的位置处,静态插入一个文件。 A 、page 指令标签 B 、page 指令的 import 属性 指令标签 D 、include 动作标签 8. 以下对象中的( D )不是 JSP 的内置对象。 A 、request B 、session C 、application

新视野大学英语4册第二版课后习题答案.doc

新视野大学英语(第2版)第4册Unit 1答案 III. 1. idle 2. justify 3. discount 4. distinct 5. minute 6.accused 7. object 8. contaminate 9. sustain 10. worship IV. 1. accusing... of 2. end up 3. came upon 4. at her worst 5. pa: 6. run a risk of 7. participate in 8. other than 9. object to/objected V 1. K 2. G 3. C 4. E 5. N 6.0 7.1 8. L 9. A 10. D Collocation VI. 1. delay 2. pain 3. hardship 4. suffering 5. fever 6. defeat 7. poverty 8. treatment 9. noise 10. agony Word building VII. 1. justify 2. glorify 3. exemplifies 4. classified 5. purified 6. intensify 7. identify 8. terrified VIII. 1. bravery 2. jewelry 3. delivery 4. machinery 5. robbery 6. nursery 7. scenery 8. discovery sentence Structure IX. 1. other than for funerals and weddings 2. other than to live an independent life 3. other than that they appealed to his eye . . ` 4. but other than that, he'll eat just about everything . 5. other than that it's somewhere in the town center X. 1. shouldn't have been to the cinema last night 2. would have; told him the answer 3. they needn't have gone at all 4. must have had too much work to do 5. might have been injured seriously XIII. 1 .B 2.A 3.C 4.D 5. B 6.A 7.B 8.A 9. C 10.A II.D 12.C 13. D 14.A 15. C 16.D 17.B 18.C I9. A 20.D 新视野大学英语(第2版)第4册Unit 2答案 Section A Comprehension o f the text 1. He lived a poor and miserable life during his childhood. 2. Because no one in Britain appeared to appreciate his talent for comedy. His comic figures did not conform to British standards. 3. Because his dress and behavior didn't seem that English. 4. It was the first movie in which Chaplin spoke. 5. He used his physical senses to invent his art as he went along without a prepared script. 6. His transformation of lifeless objects into other kinds of objects, plus the skill with which he executed it again and again. 7. She brought stability and happiness to him and became a center of calm in his family. 8. Comic. Vocabulary III. 1. coarse 2. betrayed 3. incident 4. postponed 5. execute 6. surrounding 7. applause 8. extraordinary 9. clumsy 10. sparked IV. 1. for 2. against 3. up 4. about 5. up 6. to 7. down 8. down 9. in 10. on V. l. I 2.J 3.B 4.D 5.E 6.G 7.F 8.L 9.N 10.A Collocation
VI. 1. service 2. help/hand 3. influence 4. guarantee 5. visit 6. span . 7. welcome 8. spirit 9. duties 10. buildings Word Building

JSP程序设计实验代码与习题解答

第1章JSP概述 习题一解答 1.答:确保Tomcat服务器使用的是Java_home环境变量设置的JDK 2.答:见1.3.2中的新建Web服务目录。 3.答:在浏览器的地址栏中键入:http://IP:端口号/Web服务目录/子目录/JSP页面。4.答:修改Tomcat服务器安装目录中conf文件夹中的主配置文件:server.xml,只要没有其他应用程序正在占用80,就可以将端口号设置为80。

第2章JSP页面与JSP标记 习题二解答 1.答:“<%!”和“%>”之间声明的变量在整个JSP页面内都有效,称为JSP页面的成员变量,成员变量的有效范围与标记符号<%!、%>所在的位置无关。所有用户共享JSP页面的成员变量,因此任何一个用户对JSP页面成员变量操作的结果,都会影响到其他用户。 “<%”和“%>”之间声明的变量称为局部变量,局部变量在JSP页面后继的所有程序片以及表达式部分内都有效。运行在不同线程中的Java程序片的局部变量互不干扰,即一个用户改变Java程序片中的局部变量的值不会影响其他用户的Java程序片中的局部变量。当一个线程将Java程序片执行完毕,运行在该线程中的Java程序片的局部变量释放所占的内存。 2. 答:两次。 3.答:不允许。允许。 4.答:第一个用户看到的sum的值是610,第二个用户看到的sum的值是1210 5. 答: <%@ page contentType="text/html;charset=GB2312" %> <% for(char c='A';c<='Z';c++) { out.print(" "+c); } %> 6.答:include指令标记的作用是在JSP页面出现该指令的位置处,静态插入一个文件,即JSP页面和插入的文件合并成一个新的JSP页面,然后JSP引擎再将这个新的JSP页面转译成Java文件。因此,插入文件后,必须保证新合并成的JSP页面符合JSP语法规则,即能够成为一个JSP页面文件。include动作标记告诉JSP页面动态加载一个文件,不把JSP页面中动作指令include所指定的文件与原JSP页面合并一个新的JSP页面,而是告诉Java解释器,这个文件在JSP运行时(Java文件的字节码文件被加载执行)才被处理。如果包含的文件是普通的文本文件,就将文件的内容发送到客户端,由客户端负责显示;如果包含的文件是JSP文件,JSP引擎就执行这个文件,然后将执行的结果发送到客户端,并由客户端负责显示这些结果。 7. 答:

JSP课后参考答案

习题1 JSP 简介 1. 安装Tomcat5.5所在的计算机需要事先安装JDK吗? 答:需要。 2. 运行startup.bat启动Tomcat服务器的好处是什么? 答:能够确保Tomcat服务器使用的是JA V A_HOME环境变量设置的JDK. 3. Boy.jsp和boy.jsp是否是相同的JSP文件名字 不是 4. 请在D:\下建立一个名字为water的目录,并将该目录设置成一个Web服务目录,然后编写一个简单的JSP页面保存到该目录中,让用户使用权虚拟目录fish来访问该JSP页面? 答:设置方法: ①建立D:\ water目录; ②修改server.xml文件,在上一行添加: ③使用http://localhost:8080/ fish /example1_1.jsp访问 example1_1.jsp页面.

5. 假设Dalian是一个Web服务目录,其虚拟目录为moon, A.jsp保存在Dalian的子目录sea中。那么在Tomcat服务器(端口号8080)所在计算机的浏览器键入下列哪种方式是访问A.jsp的正确方式?A.http://127.0.0.1:8080/A.jsp B. http://127.0.0.1:8080/Dalian/A.jsp C. http://127.0.0.1:8080/moon/A.jsp D. http://127.0.0.1:8080/moon/sea/A.jsp 答:D 6. 如果想修改的端口号,应当哪个文件?能否将端口号修改为80?答:修改Tomcat服务器的conf目录下的主配置文件server.xml可以更改端口号. 若Tomcat服务器上没有其他占有80端口号的程序,可以将其修改为8080,否则不能。 习题2 JSP页面 1."<%!"和"%>"之间声明的变量与"<%"和"%>"声明的变量有何不同? 答: "<%!"和"%>"声明的变量为类的成员变量,其所占的内存直到

新视野大学英语册第二版课后习题答案全解

Unit 1答案2版)第4册新视野大学英语(第4. but other than that, he'll eat just about everything . 5. other than that it's somewhere in the town center III. X. 1. idle 2. justify 3. discount 4. distinct 5. minute 1. shouldn't have been to the cinema last night 6.accused 7. object 8. contaminate 9. sustain 10. worship told him the answer 。2. would haveIV. 3. they needn't have gone at all 1. accusing... of 2. end up 3. came upon 4. at her worst 5. pa: 4. must have had too much work to do 6. run a risk of 7. participate in 8. other than 9. object to/objected 5. might have been injured seriously 1. 这种植物只有在培育它的土壤中才能很好地成长。Collocation The plant does not grow well in soils other than the one in which it has been VI. developed. 1. delay 2. pain 3. hardship 4. suffering 5. fever 研究结果表明,无论我们白天做了什么事情,晚上都会做大约两个小时2. 6. defeat 7. poverty 8. treatment 9. noise 10. agony 的梦。Word building Research findings show that we spend about two hours dreaming every night, VII. no matter what we may have done during the day. 1. justify 2. glorify 3. exemplifies 4. classified 有些人往往责怪别人没有尽最大努力,以此来为自己的失败辩护。3. 5. purified 6. intensify 7. identify 8. terrified Some people tend to justify their failure by blaming others for not trying their VIII. best. 1. bravery 2. jewelry 3. delivery 4. machinery 我们忠于我们的承诺:凡是答应做的,我们都会做到。4. 5. robbery 6. nursery 7. scenery 8. discovery We remain true to our commitment: Whatever we promised to do, we would sentence Structure do it. 连贝多芬的父亲都不相信自己儿子日后有一天可能成为世界上最伟大的5. IX. 音乐家。爱迪生也同样如此,他的老师觉得他似乎过于迟钝。1. other than for funerals and weddings Even Beethoven's father discounted the possibility that his son would one day 2. other than to live an independent life become the greatest musician in the world. The same is true of Edison, who 3. other than that they appealed to his eye . . ` 1 / 7 seemed to his teacher to be quite dull. sentence structure 当局控告他们威胁国家安全。6. They were accused by the authorities of threatening the state security. X. 1. it is a wonder to find

JSP程序设计实用教程期末考试试卷A及答案

《JSP程序设计实用教程》期末考试试卷(A卷) (考试时间90分钟,满分100分) 一、选择题(1~40题,每题1分,共40分) 下面各题A、B、C、D四个选项中,只有一个选项是正确的,请将正确选项涂抹在答题卡相应的位置上,答在试卷上不得分。 1.在传统的HTML页面中加入()就构成了一个JSP页面文件。 A.JAVA程序片B.JSP标签 C.用“<%”、“%>”标记符号括起来的程序D.JAVA程序片和JSP标签 2.配置JSP运行环境,若WEB应用服务器选用TOMCAT,以下说法正确的是:()A.先安装TOMCAT,再安装JDK B.先安装JDK,再安装TOMCAT C.不需安装JDK,安装TOMCAT就可以了 D.JDK和TOMCAT只要都安装就可以了,安装顺序没关系 3.对于“<%!”、“%>”之间声明的变量,以下说法正确的是:() A.不是JSP页面的成员变量 B.多个用户同时访问该页面时,任何一个用户对这些变量的操作,都会影响到其他用户C.多个用户同时访问该页面时,每个用户对这些变量的操作都是互相独立的,不会互相影响 D.是JSP页面的局部变量 4.在客户端浏览器的源代码中可以看到()。 A.JSP注释 B.HTML注释 C.JSP注释和HTML注释 D.JAVA注释 5.page指令的作用是:()。 A.用来定义整个JSP页面的一些属性和这些属性的值 B.用来在JSP页面内某处嵌入一个文件 C.使该JSP页面动态包含一个文件 D.指示JSP页面加载Java plugin 6.page指令的import属性的作用是()。 A.定义JSP页面响应的MIME类型 B.定义JSP页面使用的脚本语言 C.为JSP页面引入JAVA包中的类 D.定义JSP页面字符的编码 7.page指令的()属性可以设置JSP页面是否可多线程访问。 A.session B.buffer C.isThreadSafe D.info 8.()可在JSP页面出现该指令的位置处,静态插入一个文件。 A.page指令标签 B.page指令的import属性 C.include指令标签

JSP复习题及部分答案

一、判断题 HTML称为超文本元素语言,它是Hypertext Marked Language的缩写。(对) 一个HTML文档必须有和元素。(错) 超级链接不仅可以将文本作为链接对象,也可以将图像作为链接对象。(对) 在网页中图形文件与网页文件是分别存储的。(对) 绝度路径是文件名的完整路径;相对路径是指相对当前网页文件名的路径。(对) 超级链接<a>标记的target属性取值为链接的目标窗名,可以是parent、blank、 self、top。(错) 当样式定义重复出现的时候,最先定义的样式起作用(错)。 JSP中Java表达式的值由服务器负责计算,并将计算值按字符串发送给客户端显示。(对)在Java程序片中可以使用Java语言的注释方法,其注释的内容会发送到客户端。 (错) 表单域一定要放在<form>元素中。(对) 用户在浏览器中输入,不同的客户之间不共享。(错) 在“<%!”和“%>”标记之间声明的Java的方法在整个页面内有效。(对) 程序片变量的有效范围与其声明位置有关,即从声明位置向后有效,可以在声明位置后的程序片、表达式中使用。(对) 程序片变量不同于在“<%!”和“%>”之间声明的页面成员变量,不能在不同客户访问页面的线程之间共享。(对) JSP中Java表达式的值由服务器负责计算,并将计算值按字符串发送给客户端显示。(对) 在Java程序片中可以使用Java语言的注释方法,其注释的内容会发送到客户端。(错) 不可以用一个page指令指定多个属性的取值。(错) jsp:include动作标记与include指令标记包含文件的处理时间和方式不同。(对) jsp:param动作标记不能单独使用,必须作为jsp:include、jsp:forward标记等的子标记使用,并为它们提供参数。(对) <jsp:forward ... >标记的page属性值是相对的URL地址,只能静态的URL。(错) JSP页面只能在客户端执行。(错) JSP页面中不能包含脚本元素。(错) Page指令不能定义当前JSP程序的全局属性。(错) out对象是一个输出流,它实现了接口,用来向客户端输出数据。(对) contentType属性用来设置JSP页面的MIME类型和字符编码集,取值格式为"MIME 类型"或"MIME类型;charset=字符编码集",response对象调用addHeader方法修改该属性的值。(错) 利用response对象的sendRedirect方法只能实现本网站内的页面跳转,但不能传递参数。(错) public long () 设置最长发呆时间,单位毫秒。(错) respone对象主要用于向客户端发送数据。(对) Post属于表单的隐式提交信息方法。(对) <select>标记用于在表单中插入一个下拉菜单。(对)</p><h2>全新版大学英语综合教程第二版课后练习答案定稿版</h2><p>全新版大学英语综合教程第二版课后练习答案精编W O R D版 IBM system office room 【A0816H-A0912AAAHH-GX8Q8-GNTHHJ8】</p><p>Unit1 Ways of Learning Vocabulary I 1. 1)insert 2)on occasion 3)investigate 4)In retrospect 5)initial 6)phenomen a 7)attached 8)make up for 9)is awaiting 10)not; in the least 11)promote 12)emerged 2. 1)a striking contrast between the standards of living in the north of the country and the south. 2)is said to be superior to synthetic fiber. 3)as a financial center has evolved slowly. 4)is not relevant to whether he is a good lawyer.</p><p>5)by a little-known sixteen-century Italian poet have found their way into some English magazines. 3. 1)be picked up; can’t accomplish; am exaggerating 2)somewhat; the performance; have neglected; they apply to 3)assist; On the other hand; are valid; a superior II 1)continual 2)continuous 3)continual 4)continuous 5)principal 6)principal 7)principle 8)principles 9)principal III 1.themselves 2.himself/herself 3.herself/by herself/on her own 4.itself</p><h2>JSP课后习题及答案</h2><p>1. Web技术的设想在()年提出 A.1954 B.1969 C.1989 D.1990 2. JSP页面在第一次运行时被JSP引擎转化为() A.HTML文件 B. CGI文件 C. CSS文件 D.Servlet 文件 3. JavaEE体系中Web层技术是() A. HTML B. JavaBean C. EJB D. JSP 1 用来换行的标签是() A.<P> B.<br> C.<hr> D.<pre> 2. 用来建立有序列表的标签是() A.<ol></ol> B.<ul></ul> C.<dl></dl> D.<il></il> 3. 用来插入图片的标签是() A.<img> B.<image> C.<bgsound> D.<table> 4. css文件的扩展名为() A.doc B. text C. html D. css 1. 有关JSP中的HTML注释叙述正确的是() A.发布网页时看不到,在源文件中也看不到。 B.发布网页时看不到,在源文件中能看到。 C.发布网页时能看到,在源文件中看不到。 D.发布网页时能看到,在源文件中也能看到。 2. JSP支持的语言是() A. C语言 B. C++语言 C. C#语言 D. Java语言</p><p>3. 在同一个JSP页面中page指令的属性中可以使用多次的是() A. Import B. session C. extends D. Info 4. 用于获取Bean属性的动作是() A.<jsp:useBean> B.<jsp:getProperty> C.<jsp:setProperty> D.<jsp:forward> 5. 用于为其他动作传送参数的动作是() A.<jsp:include> B.<jsp:plugin> C.<jsp:param> D.<jsp:useBean> 1. Pesponse对象的setHeader(String name,String value)方法的作用是() A.添加HTTP文件头 B.设定指定名字的HTTP文件头的值 C.判断指定名字的HTTP文件头是否存在 D.向客户端发送错误信息 2. 设置session的有效时间(也叫超时时间)的方法是() A. setMaxInactiveInterval(int interval) B. getAttributeName() C. setAttributeName(String name,https://www.360docs.net/doc/aa5685319.html,ng.Object value) D. getLastAccessedTime() 3. Out对象中能清除缓冲区中的数据,并且把数据输出到客户端的方法是() A. out.newLine() B. out.clear() C. out.flush() D. out.clearBuffer() 4. pageContext对象的findAttribute()方法作用是() A. 用来设置默认页面的范围或指定范围之中的已命名对象</p><h2>新视野大学英语2册课后题答案</h2><p>新视野大学英语Book II课后练习题答案 Unit 1 Section A Language focus 3.Words in use 1.condense 2.exceed 3.deficit 4.exposure 5.asset 6.adequate https://www.360docs.net/doc/aa5685319.html,petent 8.adjusting 9.precisely 10.beneficial 4.Word building Words learned new words formed -al/ial manager managerial editor editorial substantial substance survive survival traditional tradition marginal margin -cy Consistent consistency Accurate accuracy Efficiency efficient -y Recover recovery Minister ministry assemble assembly 5. 1.editorial 2.recovery 3.accuracy 4.substance 5.managerial 6.margin 7.assembly 8.Ministry 9.survival 10.tradition 11.consistency 12.efficient</p><p>6.Banked cloze 1.L 2.C 3.J 4.A 5.I 6.O 7.N 8.E 9.H 10.F 7.Expressions in use 1.feel obliged to 2.be serious about 3.run into 4.distinguish between 5.thrust upon 6.was allergic to 7.get lost 8.be attracted to 9.make sense 10.looked upon as 9.Translate the following paragraph into Chinese. 人们普遍认为英语是一种世界语言,经常被许多不以英语为第一语言的国家使用。与其他语言一样,英语也发生了很大的变化。英语的历史可以分为三个主要阶段,古英语,中古英语和现代英语。英语起源于公元5世纪,当时三个日耳曼部落入侵英国,他们对于英语语言的形成起了很大的作用。在中世纪和现代社会初期,英语的影响遍及不列颠群岛。从17世纪初,它的影响力开始在世界各地显现。欧洲几百年的探险和殖民过程导致了英语的重大变化。今天,由于美国电影,电视,音乐,贸易和技术,包括互联网的大受欢迎,美国英语的影响力尤其显著。 10.Translate the following paragraph into English Chinese calligraphy is a unique art and the unique art treasure in the world. The formation and development of the Chinese calligraphy is closely related to the emergence and evolution of Chinese characters. In this long evolutionary process,Chinese characters have not only played an important role in exchanging ideas and transmitting culture but also developed into a unique art form.Calligraphic works well reflect calligraphers’ personal feeling, knowledge, self-cultivation, personality, and so forth, thus there is an e xpression that “seeing the calligraphers’ handwriting is like seeing the person”. As one of the treasures of Chinese culture, Chinese calligraphy shines splendidly in the world’s treasure house of culture and art. Section B 4.words in use 1.mysterious 2.desperate 3.devise 4.negotiate 5.recalled 6.specifically 7.depict 8.ignorance 9.expand 10.confusion 5.Expressions in use</p></div> <div class="rtopicdocs"> <div class="coltitle">相关主题</div> <div class="relatedtopic"> <div id="tabs-section" class="tabs"> <ul class="tab-head"> <li id="13197131"><a href="/topic/13197131/" target="_blank">第二版习题参考答案</a></li> <li id="12930541"><a href="/topic/12930541/" target="_blank">新视野第二版题库答案</a></li> <li id="313150"><a href="/topic/313150/" target="_blank">jsp课后答案</a></li> <li id="16184450"><a href="/topic/16184450/" target="_blank">jsp程序设计试卷</a></li> </ul> </div> </div> </div> </div> <div id="rightcol" class="viewcol"> <div class="coltitle">相关文档</div> <ul class="lista"> <li><a href="/doc/a73965843.html" target="_blank">离散数学(第二版)最全课后习题答案详解</a></li> <li><a href="/doc/f22837141.html" target="_blank">有机化学 第二版 徐寿昌 课后习题参考答案(全)</a></li> <li><a href="/doc/139398414.html" target="_blank">全新版大学英语综合教程第二版课后练习答案定稿版</a></li> <li><a href="/doc/3a12660080.html" target="_blank">有机化学第二版课后习题答案</a></li> <li><a href="/doc/4e17219889.html" target="_blank">数据库应用技术(第二版)习题参考答案</a></li> <li><a href="/doc/8d4468887.html" target="_blank">《国家税收》第二版习题参考答案。</a></li> <li><a href="/doc/ca4387615.html" target="_blank">计算机网络第二版_部分习题参考答案</a></li> <li><a href="/doc/2b16011467.html" target="_blank">计算机网络第二版_部分习题参考答案</a></li> <li><a href="/doc/4b1761007.html" target="_blank">操作系统(第二版)课后习题答案</a></li> <li><a href="/doc/5a14249997.html" target="_blank">嵌入式技术基础与实践第二版习题参考答案</a></li> <li><a href="/doc/9d8149675.html" target="_blank">数值方法(第二版)课后习题答案</a></li> <li><a href="/doc/ed1875163.html" target="_blank">有机化学 第二版 徐寿昌 课后习题参考答案全</a></li> <li><a href="/doc/191118498.html" target="_blank">大学化学(第二版)部分习题参考答案</a></li> <li><a href="/doc/309097478.html" target="_blank">有机化学_第二版_徐寿昌_课后习题参考答案(全)</a></li> <li><a href="/doc/4d13580280.html" target="_blank">流体力学第二版课后习题答案</a></li> <li><a href="/doc/7f876197.html" target="_blank">大学化学第二版部分习题参考答案</a></li> <li><a href="/doc/b417244982.html" target="_blank">全大学英语综合教程第二版课后练习答案</a></li> <li><a href="/doc/f317172158.html" target="_blank">测试技术第二版课后习题答案</a></li> <li><a href="/doc/215902807.html" target="_blank">C语言程序设计第二版习题参考答案</a></li> <li><a href="/doc/3e17429876.html" target="_blank">《金融数学》(第二版)习题参考答案(修订版)</a></li> </ul> <div class="coltitle">最新文档</div> <ul class="lista"> <li><a href="/doc/0f19509601.html" target="_blank">幼儿园小班科学《小动物过冬》PPT课件教案</a></li> <li><a href="/doc/0119509602.html" target="_blank">2021年春新青岛版(五四制)科学四年级下册 20.《露和霜》教学课件</a></li> <li><a href="/doc/9b19184372.html" target="_blank">自然教育课件</a></li> <li><a href="/doc/3019258759.html" target="_blank">小学语文优质课火烧云教材分析及课件</a></li> <li><a href="/doc/d819211938.html" target="_blank">(超详)高中语文知识点归纳汇总</a></li> <li><a href="/doc/a419240639.html" target="_blank">高中语文基础知识点总结(5篇)</a></li> <li><a href="/doc/9d19184371.html" target="_blank">高中语文基础知识点总结(最新)</a></li> <li><a href="/doc/8a19195909.html" target="_blank">高中语文知识点整理总结</a></li> <li><a href="/doc/8519195910.html" target="_blank">高中语文知识点归纳</a></li> <li><a href="/doc/7f19336998.html" target="_blank">高中语文基础知识点总结大全</a></li> <li><a href="/doc/7119336999.html" target="_blank">超详细的高中语文知识点归纳</a></li> <li><a href="/doc/6619035160.html" target="_blank">高考语文知识点总结高中</a></li> <li><a href="/doc/6719035161.html" target="_blank">高中语文知识点总结归纳</a></li> <li><a href="/doc/4a19232289.html" target="_blank">高中语文知识点整理总结</a></li> <li><a href="/doc/3b19258758.html" target="_blank">高中语文知识点归纳</a></li> <li><a href="/doc/2619396978.html" target="_blank">高中语文知识点归纳(大全)</a></li> <li><a href="/doc/2b19396979.html" target="_blank">高中语文知识点总结归纳(汇总8篇)</a></li> <li><a href="/doc/1419338136.html" target="_blank">高中语文基础知识点整理</a></li> <li><a href="/doc/ed19066069.html" target="_blank">化工厂应急预案</a></li> <li><a href="/doc/bd19159069.html" target="_blank">化工消防应急预案(精选8篇)</a></li> </ul> </div> </div> <script> var sdocid = "a4c94aac905f804d2b160b4e767f5acfa1c783de"; </script> <div class="clearfloat"></div> <div id="footer"> <div class="ft_info"> <a href="https://beian.miit.gov.cn">闽ICP备16038512号-3</a> <a href="/tousu.html" target="_blank">侵权投诉</a>  ©2013-2023 360文档中心,www.360docs.net | <a target="_blank" href="/sitemap.html">站点地图</a><br /> 本站资源均为网友上传分享,本站仅负责收集和整理,有任何问题请在对应网页下方投诉通道反馈 </div> <script type="text/javascript">foot()</script> </div> </body> </html>