`
mangoo1
  • 浏览: 18710 次
  • 性别: Icon_minigender_1
  • 来自: 广州
社区版块
存档分类
最新评论
阅读更多
Topics Cover Concepts like Inheritance, Polymorphism, Threads, Garbage Collection, Java IO, JDBC, AWT, Swing, Networking API and many more. Trust me the test is really tough and out of the 5 options upto 3 options may be correct. You get negative marks
if you select incorrect option and also if you skip a question. The test is adaptive so if you answer correctly level of
question increases.

There are around 42 questions which needs to be completed in 105 minutes.
It's upto the person who has setup the test for you the results may be displayed when
test ends or may not be but will be directly mailed to the person in that case.

Hi Guys,

I thought I will share IKM experience, for people who are planning to take.

I have just finished doing an IKM Exam, 10 minutes back. Overall, I have done four IKM Exams, this year, and two of it in the last one week..
1. Distributed Programming
2. XML
3. Java2 Programming
4. Java2 / J2EE Programming.

You are expecting a tough exam. Atleast, it was tough for me, all of them

Exam Pattern:

It is objective based with three possible answers, but not always and does not say how many answers / question, either. Credit is provided as long as you are able to get close to the answers. Say two answers are correct out of 3. Conversely, you have deductions in credit, if you blindly choose anything irrelevant. (that proves absolutely no knowledge in that area) .

You cannot go back to a question, that you have answered already

Questions are made increasingly difficult, when you are answering good and if you find an easy question, all of a sudden, you already know how you have been answering the previous question.

Questions:
On average, you have around 30 - 40 questions and the time limit is 90 minutes maximum. Expect plenty of code based questions.

Syllabus: I do not know if they provide any definite syllabus beforehand and the questions are from all possible areas inside the topic. e.g., when I did the xml IKM, the questions were from XDR, Xpointer, XLink, Xquery and all sorts...

Test Results: The test results shows you are overall percentage. It shows your strengths on each subtopics related to the exam, on three grades (Strong,Proficient,Weak)

You can see your test results, if the test organiser has set up that way. I had an opportunity to see only for Java 2 Programming. So added the topics below
Java 2 Programming: Usual Java (fundamentals,package,i/o,operators,threads., etc.,) JVM Memory Management Security Framework + AWT


Hope it helps.

Java EE 概述
Javaa EE:分布式 企业级应用规范和标准

推模式:不用请求,强制让客户接受
拉模式:让客户请求和响应。

架构:
轻量级:struct2 /spring /hibernate
Modle1:jsp+JavaBean+DB
Model2(MVC):jsp+servlet+JavaBean+DB

重量级:Jsp+servlet+EJB+DB

表示层:业务层:持久层:数据库:

JNDI:查找分布对象的机制,明命目录服务。
DataSouce:EJB:JMS队列。

Session:用于判断或区分是否是同一个用户的请求
Web Service:将自我分协议交给外部调用。
B/S:优点:维护性高,运行效率不高,页面不美观。

接受客户段请求的数据:request.getprameter();
Request.getprameterValues();
Request.Head();
Request.cooket();

计算机间的数据传输方式(协议):http,Ftp,Udp。

Servlet基础
容器
用来容纳组件,管理对象的生命周期
Servlet的生命周期
加载和实例化
用户请求时servlet容器负责加载和实例化servlet,首先在容器中查找,如果存在则取出,
不存在则创建servlet实例。
初始化init()
当容器加载好servlet实例后,初始化servlet时,可设置连接参数,或对其他资源的引用。
服务service()
Servlet初始化后,就处于相应请求的就绪状态。请求对象以参数的形式传给service()方法,由它来判断处理请求的方式。0
销毁destroy()
Servlet的实例是由servlet容器创建的,由容器来判断一个servlet被释放时,Destory()方法来指明那些方法可以被系统回收

实例变量在service()方法中声明。
本地变量在处理方法中声明;

Servlet在服务器运行之前启用
<load-on-startup>1</load-on-startup>
Servlet容器 何时装载Servlet
1. 判断部署描述符中有没有<load-on-startup>
2. 当用户请求时servlet才装载;
通过jsp文件来充当servlet
  <servlet-name>loginjsp</servlet-name>
  <jsp-file>login.jsp</jsp-file>
  <servlet-name>loginjsp</servlet-name>
  <url-pattern>jsp文件的绝对路径</url-pattern>

添加
Http:是应用层协议,使用下层的tcp/ip转换层来完成
Url:统一资源标识符,拥于指定和构成web资源的字符窜的各个不同的部分。

ServletContext对象是个web服务器中的一个已知路径的根。
Servlet上下文被订位为http://loclhost:8080//project
Project请求路径(成为上下文的根)

可通过servletConfig对象getServletConfing()方法,来得到ServletContext对象。

Servlet getConfig(String url)
url:给出url相对应ServletContext对象的集合。

ServletContext保存的属性可在多个客户端之间共享属性。

开发线程安全的Servlet:
Public synchronized void doGet(request,response);
Public synchronized void doPost(request,response);

项目部署时自动创建数据库的CreateDBServlet
executeUpdate(“create database”);
executeUpdate(“create table”)
………….

Web.xml中:
  <servlet>
  <servlet-name>CreateDBServlet</servlet-name>
  <servlet-class>org.majm.dao.CrateDBServlet</servlet-class>
  <init-param>
  <param-name>driverClass</param-name>
<param-value>com.microsoft.sqlserver.jdbc.SQLServerDriver</param-value>
  </init-param>
  <init-param>
  <param-name>url</param-name>
  <param-value></param-value>
  </init-param>
  <init-param>
  <param-name>user</param-name>
  <param-value></param-value>
  </init-param>
  <init-param>
  <param-name>pwd</param-name>
  <param-value></param-value>
  </init-param>
  </servlet>
 
  <servlet-mapping>
  <servlet-name>CreateDBServlet</servlet-name>
  <url-pattern></url-pattern>
  </servlet-mapping>

Servlet 的异常出理机制
为了向客户端显示非常有好的错误提示。
Servlet 中有两种服务器端的异常处理机制。
1. 声明式异常处理:
2. 程序式异常处理:

Servlet过滤器的用途:
•用户认证与授权管理
•统计web应用的访问量
•实现web应用的日志处理
•实现数据的压缩功能
•对传输数据进行加密
•实现XML文件的XSLT转换


声明式异常处理:Http错误web.xml
<error-page>
  <error-code>404</error-code>
  <location>/FileNotFound.html</location>
  </error-page>
FileNotFound.html中国加入:您所访问的页面不纯在,或移动到其他地方,如有其他页面,请访问首页。

程序式异常处理:Java异常处理web.xml
  <error-page>
  <exception-type>java.Sql.SQLException</exception-type>
  <location>/servlet/ExceptonServlet</location>
  </error-page>

通知servlet容器这个servlet永久不可用的“异常”;
throw new UnavailableException("数据库驱动加载异常");

使用RequestDispatcher来处理异常:


Servlet的会话跟踪
会话:服务器应当能够标示出来自单个客户的一系列请求,并把这些请求组成单独的工作会话。
状态:服务器应当能够记住前面请求的信息,以及对前一请求做出的处理信息

Servlet:规范规范中,描述了三种机制拥有会话跟踪。
SSL:安全套接字层,会话
Cookie:
Url:重写

SSL:是在TCP/IP之上种HTTP之下应用协议下的一种加密技术。
在客户端和服务器之间保持一种加密的连接。

Cookie:(甜饼)
以键值对象的方式记录会话跟踪的内容。
Name是Cookie的名字,用于会话的以JSESSIONID开头
Value是它的值。

URL重写:
当客户端不接受Cookie的时候,使用Url重写的机制来跟踪用户会话。
参数名必须是JSESSIONID做为URL的一部分发送给客户端。

Javax.servlet.http.HttpSession接口
封装了Session的概念。
HttpSession接口的方法。
Public object getAttribute(String )
Public java.util.Enumberation getAttributeNames();
Public void remoeAttribute(java.lang.String name);
Public void setAttrivute(java.lang.String name, java.lang.Object value);
以上用于读取,移除,和设置Session
Public long getCreateionTeme();//返回在什么时间创建时Session
Puboic string geId();//返回分配Session的唯一标识号

Public int getMaxInactiveInterval();//以毫秒为单位,servlet容器在客户的连个连接中请求的最大时间间隔;
Public void setMaxInactiveInterval();//设置,servlet容器在客户的连个连接中请求的最大时间间隔;

Public void ivalidate();//销毁这次会话

Public bookean isNew();//返客户端有无加入到Session中

Session 是一种服务器端的技术
Session 对象在服务器端创建
通过散列表来存储信息
Cookie是在客户端保存的信息
为了跟踪会话,服务器端在创建session后,要将SessionID交给客户端;

Tomcat6.0 通过配置可实现session的持久化
性能提高:
首页时:request.getSession();//查看有没有,没有的话直接创建
其他页面:request.getSession(bollean value);//如果有就返回
循环的时候拼接字符窜:不要用Stirng;用StirngBuffer

面试时问:page范围大还是“request”范围大
1. 页面中有多个请求时 page>request
2. 请求跨多个页面时 request>page

性能提高(网络中)
尽量传递基本数据类型。对象传递引响性能。

实体类在WEB应用中要实现对象序列化(网络传输中是以01010的形式保存的)。

常用的集合类,接口
1. 线程同步的。
2. 非线程同步的。

线程同步的。
Vector, Hashtable,
非线程同步的
1. 原值。Collection接口(包括list[可重复,可排序]和Set[不可重复,不排序]接口)
2. 对值。Map接口。
List :接口与其实现类实体容量可变的列表,按索引访问集合的元素,是有序的集合。
Set接口:set是一种不包含重复元素的Collection,set中只能有一个null元素,
HeshSet:能够快速定位一个元素,单要求存入的HashSet对象必须实现HashCode()方法。
TreeSet:将放入其中的元素按序存放。

Map接口:
HashMap 实现一个建到值映射的哈希表,通过建取得值对象。
Properties:把属性文件读入流中,以键值对的形式进行保存

基于Servlet的MVC设计模式
模式是什么:
模式:是一种重复利用的设计思想

开——闭 原则:
一个软件实体化应当对扩展开放,对修改关闭。

李氏代换原则:
对实现抽象化的具体步骤的规范。

迪米特法则:
一个软件实体应当与尽可能少的其他实体发生相互作用:

依赖倒转原则:
A.高层模块不应该依赖与低层模块,两者都应该依赖抽象。
B.抽象不应该依赖细节,细节应该依赖抽象。

合成/聚合复用原则:
在一个新对象里面使用一些已有的对象,使之成为一个新的对像的一部分,
新的对象通过向这些对象的委派达到复用已有功能的目的。

MVC设计模式
模型(Model):
视图(View):
控制器(Controller):

优点:
1, 各施其职,互不干渋。
2, 有利于开发分工中的合作。
3, 有利于组件的重用。

横向:
客户端IE
中间件jsp/servlet/EJB/
持久层:
纵向:
应用程序
Java EE服务器()
DB
OS

Model层开发:高级JDBC
6.Model层开发:高级JDBC
JDBC数据库操作方式
1.jdbc:DriverManager(,,,); getConnection();properties配置文件
2.JNDI->DataSource.getConnection();连接池
3.Hibernate ORM 映射框架。自动连接管理。

DataSource(数据源)
数据来源的地方。

web应用中的2种执行方式
1.将结果在远程执行返回结果回来。
2.将对象通过网络送回来。在本地执行

JNDI:java命名目录规范(接口)
javax.maning.context (J2EE设计模式)

对性能的影响
业务算法复杂,
持久层网络的消耗。

JNDI的配置
/*
* Context.xml中
<Resource name="jdbc/Databases"
auth="Container"
type="javax.sql.DataSource"
maxActive="100"
maxIdle="30"
maxWait="1000"
username="sa"
password=""
driverClassName="com.microsoft.sqlserver.jdbc.SQLServerDriver"
url="jdbc:microsoft:sqlserver://localhost:1433;DatabaseName=Databases"/>
*/

/*
* web.xml中
<resource-ref>
<description></description>
<res-ref-name>jdbc/Databases</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>



View层开发:JavaBean,EL,JSTL的使用。

1. JavaBean
7.View层开发
CBD基于组件的开发
组件开发:面向对象向的高级开发。
VO:值对象,封装视图数据
BO:业务对象。
PO:持久对象。封装存储数据。

VO/PO -->TO(实体类)


jsp中分离代码的方式
1.servlet
2.JavaBean
3.Hellp类
3.标签库
4.MVC设计

class: 先找,再建。
type: 只找,不创建
(但也可作为接口和抽象类来描述)但web容器的寻找范围是重小到大。
2. EL(Expression Language)

7.View层开发:EL和JSTL
EL语法
${EL表达式}
可在Web应用中,多个页面来使用。
OGNL: 对象图导航语言。

JSTL:

EL:隐式对象
作用域范围有关的对象
pageScope
requestScope
sessionScope
applicationScope

与输入输出有关的对象
param
paramValues

其它隐含对象
pageContext
cookie
head
headValues
initParam

el运算符    说明
!或not 布尔值取反
empty 检查空值
* 乘法
/或div 除法
%或mod 求余
+ 加法
- 减法
<或lt 小于
>或gt 大于
<=或le 小于等于
>+或ge 大于等于
==或eq 等于
!=或ne 不等于
&&或and 逻辑与
||or 逻辑或
num1?num2:result条件运算符

EL运算符示例 输出结果
表达式
${5+4} 9
${5-4} 1
${5*4} 20
${5/4} 1.25
${5 mod 4} 1
${5<4} or ${5 lt 4} false
${5>4} or ${5 gt 4} true
${5.4>=5.3} or ${5.4 ge 5.3} true
${(5>4)?5:6} 5
${1>(4/2)} false
${4.0>=3} true
${100.0>=3} frue
${(10*10) ne 100} false
${'a'<'b'}     true
${'hip'gt'hit'} false
${4>3} true
${1.2E4+1.4} 120014
${3 div 4} 0.75
${10 mod 4} 2

3. JSTL标准标记库
分 类 URI Prefix
核心标记库 http://java.sun.com/jsp/jstl/core
C
XML标记库 http://java.sun.com/jsp/jstl/xml
X
格式标记库 http://java.sun.com/jsp/jstl/fmt
Fmt
SQL标记库 http://java.sun.com/jsp/jstl/sql
Sql
函数标记库 http://java.sun.com/jsp/jstl/function
Fn
JSTL核心标记库提供几乎说有jsp应用都要用到的基本功能的标记集合,包括通用标记,条件处理标记,循环与迭代标记,URL操作标记
JSTL的函数标记库提供标准函数库,一些公用的功能。
JSTL的格式标记库提供了一个对格式化对象的访问。
JSTL提供了SQL标记库与关系数据库的交互功能。

Web Service


1. EJB是:  [B]
A. 服务器端产品
B. 服务器端组件开发架构
C. 特殊类型的JavaBean
D. 用于实现商业逻辑

2. EJB架构主要使用的设计模式是: [AC]
A. Proxy 代理
B. Strategy
C. Delegate 委派
D. Responsibility Chain

3. EJB的类型主要有:  [CDF]
A. Command Bean
B. Data Access Bean
C. Session Bean
D. Entity Bean
E. Java Bean
F. Message-Driven Bean

4. Session Bean的组成可以包括:  [ACEFGI]
A. Home interface
B. A thread class
C. Remote interface
D. Primary key class
E. Local home interface
F. Local interface
G. ejb-jar.xml
H. application.xml
I. Bean class

5. Entity Bean的组成可以包括:  [ACDEFGI]
A. Home interface
B. web.xml
C. Remote interface
D. Primary key class
E. Local home interface
F. Local interface
G. ejb-jar.xml
H. ejb.xml
I. Bean class

6. Session Bean按是否跟踪客户状态分:  [BE]
A. State Session Bean
B. Stateless Session Bean  有状态
C. BMT Session Bean
D. CMT Session Bean
E. Stateful Session Bean

7. Entity Bean根据数据持久性的处理方式分:BC
A. BMT Entity Bean
B. BMP Entity Bean
C. CMP Entity Bean
D. CMT Entity Bean

8. Entity Bean的事务处理方式可采用  :C
A. BMP
B. BMT
C. CMT
D. CMP

9. Session Bean和Message-Driven Bean的事务处理方式可采用:  B
A. BMT和CMP
B. BMT和CMT
C. BMP和CMP
D. BMP和CMT

10. 申明方式的事务处理的属性有:  ACDFGH
A. Supports
B. Should
C. NotSupported
D. Required
E. Maybe
F. RequiresNew
G. Mandatory
H. Never

11. Local interface引入的目的是:  B
A. 本地客户程序才能调用EJB
B. 为了性能
C. 解决Session Bean与Enity Bean之间的交互

12. 对于Session Bean和Entity Bean, 为远程用户定义的home interface必须继承 B, component interface必须继承 D;为本地客户定义的home interface必须继承  F, component interface必须继承 A ;Session Bean的bean class必须实现 C , Entity Bean的bean class 必须实现  。E
A. EJBLocalObject
B. EJBHome
C. SessionBean
D. EJBOBject
E. EntityBean
F. EJBLocalHome

13. Message-Driven Bean的Bean Class必须实现 BC ;bean class中服务方法的签名是  A。
A. onMessage
B. MessageListener
C. MessageDrivenBean

14. 对于Session Bean和Entity Bean, 无论是remote home或是local home都必须定义create方法,该方法都会抛出的异常是C , remote home中create方法还会抛出异常 B。EntityBean的home interface中findByPrimaryKey必须抛出异常 A 。
A. FinderException
B. RemoteException
C. CreateException

15. Session Bean的home interface中可定义:A
A. create method(s)
B. Home method(s)
C. finder method(s)
D. ejbSelect method(s)

16. Entity Bean的home interface中可定义:AC
A. create method(s)
B. Home method(s)
C. finder method(s)
D. ejbSelect method(s)

17. EJBContext是EJB与EJB Container沟通的桥梁,在EJBContext中定义了与安全相关的两个方法是 CE , 与事务相关的三个方法是BFH  , 与EJB的组成相关的两个方法是 AD , 与定时服务相关的方法是  G。
A. getEJBLocalHome
B. getRollbackOnly
C. getCallerPrincipal
D. getEJBHome
E. isCallerInRole
F. setRollbackOnly
G. getTimerService
H. getUserTransaction

18. 有状态Session Bean的bean class中实现了两个方法 C和A 用来完成状态的swap in/out。
A. ejbActivate()
B. ejbCreate()
C. ejbPassivate()
D. ejbLoad()
E. ejbStore()
F. ejbPostCreate()

19. Entity Bean的bean class中实现了两个方法 DE 来同步内存与数据库的数据。
A. ejbActivate()
B. ejbCreate()
C. ejbPassivate()
D. ejbLoad()
E. ejbStore()
F. ejbPostCreate()

20. Entity Bean的home interface中的create方法会对应bean class中的 BF 方法。
A. ejbActivate()
B. ejbCreate()
C. ejbPassivate()
D. ejbLoad()
E. ejbStore()
F. ejbPostCreate()

21. 在Entity Bean的关系管理中, B 关系需要casecade delete(级连删除),   A 不能用级连删除。
A. Aggregation 聚合
B. Composition 组合

22. 在编写Message-Driven Bean的实践中,我们使用如下的编程努力来防止有毒消息的产生 BC  :
A. 用Container管理事务
B. 用Bean管理事务
C. 不抛出异常
D. 只抛出RuntimeException

23. 对DataSource的引用属于 D , 对TopicConnectionFactory的引用属于 D , 对Queue的引用属于 B , 远程客户访问EJB属于 E , Session Bean往往通过JNDI查找Entity Bean的Local Home属于 C 。对基本数据类型的封装类型的对象通过JNDI获得使用 A .
A. Environment entry
B. Resource environment reference
C. EJB local reference
D. Resource reference
E. EJB reference

24. 在weblogic上可以部署的模块有 BCD :
A. Javabean module
B. Web module
C. Enterprise application module
D. EJB module
E. Resource adapter moudle

25. weblogic与EJB相关的部署描述文件有  ABD:
A. ejb-jar.xml
B. weblogic-ejb-jar.xml
C. weblogic.xml
D. weblogic-cmp-rdbms-jar.xml
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics