Learn General Secretary on "two to learn a" strengthening "four Consciousnesses" important speech caused a strong reaction in the country.    Time, watching "red treasure", the origin of building the party back to power, how to strengthen services for the masses, improve party cohesion, fighting to become the grass-roots party members and masses hot topic. Grass-roots party organizations "two" is to strengthen the service of party members and cadres, the pioneer spirit. Distribution of grass-roots party organizations in all walks of people, clothing, shelter, which belongs to the nerve endings of the party organization and comments reputation has a direct perception of the masses.    Strengthen the party ahead of the "pedal" spirit; strengthen the party members and cadres "success does not have to be me" and "the first to bear hardships, the last to" service spirit to set the party's positive image among the people is important. Grass-roots party organizations "two" is to cleanse all
people not happy not to see "stereotypes", establish the honest faithful, diligent faith for the people. No need to avoid mentioning that, some members of our party can not stand the "money," corrosion of temptation, thin, Xu Zhou, such abuse and corrupt bribery, malfeasance borers, and rats. Two, is to clean up, thin, Xu, Zhou's solution to restore the party's fresh and natural, solid and honest work style.    Cleansing "take, eat, card," undesirable and behaviour, "cross, hard and cold, push" attitude. Grass-roots party organizations "two" is to strengthen the sense of ordinary party members, participating in co
nsciousness, unity consciousness. For reasons known, members of grass-roots party branches less mobile, less resources, and the construction of party organizations have some lag. Two studies, is to focus on the grass-roots party branches "loose, soft, loose" problem, advance the party members and cadres, "a gang working", "Hong Kong report."    Strong cleanup actions, style
and rambling, presumptuous "unqualified" party members, pays special attention to party members and cadres "joining party of thought" problem. "Party building" is obtained in the long-term development of our party's historical experience accumulated. Two is our party under the new historical conditions, strengthen the party's construction of a new "rectification movement." Grass-roots party organizations should always catch the hard work, results-oriented.  Two educational outcomes are long-term oriented and become an important impetus for the work. "Two" should have three kinds of consciousness "two" study and education, basic learning lies in the doing. Only the Constitution address the series of party rules, and do solid work, be qualified party members had a solid ideological basis. Only the "learning" and "do" real unity, to form a "learn-learn-do-do" the virtuous cycle, and ultimately achieve the fundamental objective of education. This requires that the Organization
第一篇JSP 简介
1.安装Tomcat5.5所在的计算机需要事先安装JDK吗?
答:需要。
4. 假设Dalian是一个Web服务目录,其虚拟目录为moon,    A.jsp保存在Dalian的子目录sea中。那么在Tomcat服务器(端口号8080)所在计算机的
浏览器键入下列哪种方式是访问A.jsp的正确方式?
A.127.0.0.1:8080/A.jsp            B. 127.0.0.1:8080/Dalian/A.jsp
C. 127.0.0.1:8080/moon/A.jsp
D. 127.0.0.1:8080/moon/sea/A.jsp 答:D
6.如果想修改的端口号,应当哪个文件?能否将端口号修改为80?
答:修改Tomcat服务器的conf目录下的主配置文件l可以更改端口号.
若Tomcat服务器上没有其他占有80端口号的程序,可以将其修改为8080,否则不能。
第二章JSP 语法
1."<%!"和"%>"之间声明的变量与"<%"和"%>"声明的变量有何不同?答:
"<%!"和"%>"声明的变量为类的成员变量,其所占的内存直到Tomcat服务器关闭才释放.
"<%"和"%>"为类方法中声明的局部变量,仅在JSP页面后继的程序片及表达式中有效.
2. 如果有2个用户访问一个JSP页面,该页面中的Java程序片将被执行几次?答:当有一个用户访问JSP页面,JAVA程序片就被访问一次.
3. 假设有2个不同用户访问下列JSP页面hello.jsp,请问第一个和第二个访问hello.jsp页面的用户看到的页面效果有何不同?
hello.jsp
<%@ page contentType="text/html;charset=GB2312" %>
<%@ page isThreadSafe="false" %>
<BODY><HTML>
<%!
java xml是什么
int sum=1;
void add(int m)
{
sum = sum +m;
}
}
%>
<%
int n =100;
add(n);
%>
<%=sum%>
</BODY></HTML>
答:第一个客户看到结果是101;
第二个客户看到结果是201;
7. 请简单叙述include指令标记和include动作标记的不同.
答:
include指令标记:是把被包含的文件的内容放于包含文件中,组成一个文件后编译运行.
include动作标记: 是把被包含的文件的运行结果放于包含文件运行产生的结果中,这2个文件各自编译运行.
第三章JSP 内置对象
1.假设JSP使用的表单中有如下的GUI(复选框)
<input type="checkbox" name="item" value="bird">鸟
<input type="checkbox" name="item" value="apple">苹果
<input type="checkbox" name="item" value="cat">猫
<input type="checkbox" name="item" value="">月亮
该表单所请求的JSP可以使用内置对象request对象获取该表单提交的数据,那么,下列哪些是request获取该表单提交值的正确语句?
A. String  Parameter("item");
B. String  Parameter("checkbox");
C. String  c[]=ParameterValues("item");
D. String  d[]=ParameterValues("checkbox");
答:    C.
2. 如果表单提交的信息中有汉字,接收该信息的页面应做怎样的处理?(大题)答:处理方法有2种:
第1种:
<%@ page contentType="text/html;Charset=GB2312" %>指令中的Charset首字母”C”大写.
第2种:
<%  String Parameter("number");
byte c[]=Bytes("ISO-8859-1");
str1=new String(c);
%>
4. reponse调用sendRedirect(URL: url)方法的作用是什么?(大题)
答:从一个页面跳转到sendRedirect(URL: url)中url指定的页面,并且这种跳转是客户端跳转.
6. 一个用户在不同Web服务目录中的session对象相同吗?
答:不相同.
7. 一个用户在同一Web服务目录中的session对象相同吗?
答:相同.
8. 如果用户长时间不关闭浏览器,用户的session对象可能消失吗?
答:可能消失.
9. 用户关闭浏览器后,用户的session对象一定消失吗?
答:一定消失.
第四章JSP与Javabean
1. 假设Web服务目录mymoon中的JSP页面要使用一个bean,该bean的包名为blue.sky.请说明,应当怎样保存bean的字节码文件?
答:(1)在当前Web服务目录下建立如下目录结构:
(2)Web服务目录\WEB-INF\classes
(3)根据类的包名,在目录classes下建立相应的子目录.即:
Web服务目录\WEB-INF\classes\blue\sky
(4)将获得的字节码文件保存在其中.
2. tom.jiafei.Circle是创建bean的类,下列哪个标记是正确创建session周期bean的标记?
答:
<jsp:useBean id="circll" class="tom.jiafei.Circle" scope="page"/>
<jsp:useBean id="circll" class="tom.jiafei.Circle" scope="request"/>
<jsp:useBean id="circll" class="tom.jiafei.Circle" scope="session"/>
<jsp:useBean id="circll" class="tom.jiafei.Circle" scope="session"/>
<jsp:useBean id="circll" class="tom.jiafei.Circle" scope="application"/>
答:    C.
3. 假设创建bean的类有一个int型的属性number,下列哪个方法是设置该属性值的正确方法?
A.  public void setNumber(int n)
B. void setNumber(int n)
{radius=n;                        {radius=n;
}                                }
C.  public void SetNumber(int n)
D. void Setnumber(int n)
{radius=n;                        {radius=n;
}                                }
答:      A.
第六章在JSP中使用数据库
3. 加载SQL SERVER2000纯Java驱动程序的代码是什么?
答:
Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
6. 使用CachedRowSetImpl类有什么好处?
答:
CachedRowSetImpl类的对象可以保存ResultSet对象中的数据,而且CachedRowSetImpl对象不依赖Connnection 对象,即把ResultSet对象中的数据保存到CachedRowSetImpl对象中后,就可以关闭和数据库的连接。
7. 使用预处理语句的好处是什么?
答:
预处理语句PreparedStatement会将传入的SQL命令封装在PreparedStatement对象中,事先进行预编译处理等待使用。
当有单一的SQL语句多次执行时,用PreparedStatement类会比Statement类更有效率。
第七章Java Servlet 基础
1.Servlet对象是在服务端还是在客户端创建的?
答:服务端.
2.Servlet对象被创建后首选调用init方法还是service方法?
答:init方法.
3.下面的说法是否正确?
“Servlet第一次被请求加载时调用init方法,当后续的客户请求Servlet对象时, Servlet对象不再调用init方法”.
答:正确.
4.假设创建Servlet的类是tom.jiafei.Dalian,创建的Servlet对象名字是myservlet,应当怎样配置l?(大题)
答:
<?xml version=“1.0” e ncoding="ISO-8859-1"?>
<web-app>
<servlet> <!--创建一个servlet对象-->
<servlet-name>myservlet</servlet-name> <!--对象名-->
<servlet-class>tom.jiafei.Dalian</servlet-class><!--指定创建对象的servlet
Learn General Secretary on "two to learn a" strengthening "four Consciousnesses" important speech caused a strong reaction in the country.    Time, watching "red treasure", the origin of building the party back to power, how to strengthen services for the masses, improve party cohesion, fighting to become the grass-roots party members and masses hot topic. Grass-roots party organizations "two" is to strengthen the service of party members and cadres, the pioneer spirit. Distribution of grass-roots party organizations in all walks of people, clothing, shelter, which belongs to the nerve endings of the party organization and comments reputation has a direct perception of the masses.    Strengthen the party ahead of the "pedal" spirit; strengthen the party members and cadres "success does not have to be me" and "the first to bear hardships, the last to" service spirit to set the party's positive image among the people is important. Grass-roots party organizations "two" is to cleanse all
people not happy not to see "stereotypes", establish the honest faithful, diligent faith for the people. No need to avoid mentioning that, some members of our party can not stand the "money," corrosion of temptation, thin, Xu Zhou, such abuse and corrupt bribery, malfeasance borers, and rats. Two, is to clean up, thin, Xu, Zhou's solution to restore the party's fresh and natural, solid and honest work style.    Cleansing "take, eat, card," undesirable and behaviour, "cross, hard and cold, push" attitude. Grass-roots party organizations "two" is to strengthen the sense of ordinary party members, participating in consciousness, unity consciousness. For reasons known, members of grass-roots party branches less mobile, less resources, and the construction of party organizations have some lag. Two studies, is to focus on the grass-roots party branches "loose, soft, loose" problem, advance the party members and cadres, "a gang working", "Hong Kong report."    Strong cleanup actions, style
and rambling, presumptuous "unqualified" party members, pays special attention to party members and cadres "joining party of thought" problem. "Party building" is obtained in the long-term development of our party's historical experience accumulated. Two is our party under the new historical conditions, strengthen the party's construction of a new "rectification movement." Grass-roots party organizations should always catch the hard work, results-oriented.  Two educational outc
omes are long-term oriented and become an important impetus for the work. "Two" should have three kinds of consciousness "two" study and education, basic learning lies in the doing. Only the Constitution address the series of party rules, and do solid work, be qualified party members had a solid ideological basis. Only the "learning" and "do" real unity, to form a "learn-learn-do-do" the virtuous cycle, and ultimately achieve the fundamental objective of education. This requires that the Organization -->
</servlet>
<servlet-mapping> <!--为Servlet 进行映射地址--><!--必须与Servlet 标记中的servlet-name指定的名称相同-->
<servlet-name>myservlet</servlet-name><!--具体的映射路径,前面必须
有一个/ -->
<url-pattern>/lookHello</url-pattern>
</servlet-mapping>
…..
</web-app>
6.HttpServletResponse类的sendRedirect方法和RequestDispatcher类的forward方法有何不同?
答:
javax.servlet.http .HttpServletResponse提供的方法
void sendRedirect(String location) throws IOException
客户端跳转.即当前页面可用request对象获取用户提交参数,而目标页面都
不可用request对象获取用户提交参数.
转发
javax.servlet .RequestDispatcher接口提供的方法
void  forward(ServletRequest request, ServletResponse response) // Forwards a request from a servlet to another resource (servlet, JSP file, or HTML file) on the server.
服务器跳转.即当前页面和目标页面都可用request对象获取用户提交参数.
第八章基于Servlet的MVC模式
1.在JSP中,MVC模式中的数据模型之角由谁担当?
答:由Java Bean或EJB充当
2.在JSP中,MVC模式中的控制器之角由谁担当?
答:一个或多个Servlet对象充当.
3.在JSP中,MVC模式中的视图之角由谁担当?
答:由一个或多个JSP页面或HTML页面充当.
4.MVC的好处是什么?答:
MVC是Model-View-Controller的简写。Model 代表的是应用的业务逻辑(通过JavaBean,EJB组件实现),View 是应用的表示面(由JSP页面产生),Controller 是提供应用的处理过程控制(一般是一个Servlet),通过这种设计模型把应用逻辑,处理过程和显示逻辑分成不同的组件实现。这些组件可以进行
交互和重用。
learning education, need three kinds of consciousness: one is to establish an integrated awareness. "Learning" and "do" what car isTwo-wheel, bird wings, need to go hand in hand, one end can be neglected. Communist theoretician and man. Only by closely combining theory and practice together in order to truly realize their value. "Learning" is the Foundation, the Foundation is not strong, shaking; " "Is the key to net to net thousands of accounts.    "Two" education, "" lay the basis, going to "do" the key grip, so that the "learning" and "doing" back to standard, so that the majority of party members "learn" learning theory of nutrients, in the "doing" practice party's purposes. Second, to establish a sense of depth. "Learning" and "do" not Chu drawn, entirely different, but the organic unity of the whole. "Two" learning education, we need to explore integrating "learning" in "do", exhibit "do" in "Science". To avoid the "learning" into simple room instruction, "do" into a monotone for
doing.    Should exploration "learn" in the has "do", "do" in the has "learn" of education and practice of carrier, makes general grass-roots members can in "learn" in the has "do" of achievements sense, in "do" in the has "learn" of get sense, real makes party of theory brain into heart, put for people service concept outside of Yu shaped. Third, to adhere to long-term the awareness. Style construction on the road forever, "two" had to catch the long-term. "Two" study and education, by no
means, assault-style wind-sport, but the recurrent education within the party. In recent years, the party's mass line education practice and "three-three" special education in grass-roots borne rich fruits, vast numbers of party members and cadres withstood the baptism of the spirit. "Two" greater need to focus on longer hold long-term, to establish and perfect the effective mechanism of the education, focusing on the creation of long-term education, strive to make the vast number of party members to

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。