锘??xml version="1.0" encoding="utf-8" standalone="yes"?>国产成人精品最新,日本视频一区在线观看,欧美日韩中文http://www.aygfsteel.com/SunRiver/category/15317.htmlTopics about J2EE XML AJAX SOA DB etc.zh-cnWed, 28 Feb 2007 03:11:33 GMTWed, 28 Feb 2007 03:11:33 GMT60New Questionshttp://www.aygfsteel.com/SunRiver/archive/2006/11/27/83710.htmlSun RiverSun RiverMon, 27 Nov 2006 01:26:00 GMThttp://www.aygfsteel.com/SunRiver/archive/2006/11/27/83710.htmlhttp://www.aygfsteel.com/SunRiver/comments/83710.htmlhttp://www.aygfsteel.com/SunRiver/archive/2006/11/27/83710.html#Feedback0http://www.aygfsteel.com/SunRiver/comments/commentRss/83710.htmlhttp://www.aygfsteel.com/SunRiver/services/trackbacks/83710.html Tech Tips Quiz

Over the years, the Enterprise Java Technologies Tech Tips have covered a wide variety of enterprise Java technology topics. Here's a short quiz that tests your knowledge of some topics covered in past Tech Tips. You can find the answers at the end of the quiz.

1.聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 Which of the following inheritance strategies is not supported by the Java Persistence API?

a.聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 Single Table Per Class Hierarchy

b.聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 Joined Subclass

c.聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 Single Table Per Class

d.聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 Multiple Hierarchy

2.聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 What is the primary purpose of the javax.xml.ws.Provider API?

a.聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 Binds XML to Java objects.

b.聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 Allows web services to work directly with messages.

c.聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 Simplifies WSDL creation.

d.聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 Specifies the URL of a web service provider.

e.聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 None of the above

3.聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 Which of the following statements about the ELResolver class is true?

a.聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 In Java EE 5, the classes VariableResolver and PropertyResolver have been merged into the ELResolver class.

b.聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 The way an expression is resolved can be customized by adding custom ELResolver subclasses to the ELResolver chain.

c.聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 To make an ELResolver class visible to the Java EE runtime, it must be declared in an application configuration resource file.

d.聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 All of the above.

4.聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 What does the <service-name-pattern> element in the following set of XML statements do:聽
聽聽聽聽聽聽聽聽聽聽聽 <handler-chains xmlns="http://java.sun.com/xml/ns/javaee">
聽聽聽聽聽聽聽聽聽聽聽聽聽聽<handler-chain>\
聽聽聽聽聽聽聽聽聽聽聽聽聽聽 <service-name-pattern聽 xmlns:ns1="http://example.com/handlers">
聽聽聽聽
聽聽聽聽聽聽聽聽聽聽 ns1:HelloService 聽聽聽聽
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 </service-name-pattern>

聽聽聽聽
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 <handler/>
聽聽聽聽
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 <handler/>
聽聽聽聽
聽聽聽聽聽聽聽聽聽聽聽聽聽聽 </handler-chain>
聽聽聽聽聽聽聽聽聽聽聽聽聽 </handler-chains>
聽聽聽聽

a.聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 Applies the handlers specified in the <handler-chain> element to the service with the Java EE qname {http://example.com/handlers}HelloService .

b.聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 Adds a service named HelloService to the handlers specified in the <handler-chain> element.

c.聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 Applies the handlers specified in the <handler-chain> element to all ports whose names begin with HelloService .

d.聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 None of the above.

5.聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 What role does an XMLHttpRequest object play in an AJAX-enabled application?

a.聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 It's used as a proxy to transmit requests to a server in a different domain.

b.聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 It's used to identify a filter for exchange of XML-based AJAX requests between the client and server.

c.聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 It's used to transmit AJAX requests asynchronously over HTTP to a server-side component.

d.聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 There is no such thing as an XMLHttpRequest object.

Answers

1.聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 Which of the following inheritance strategies is not supported by the Java Persistence API?

d.聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 Multiple Hierarchy. The Java Persistence API allows for three different inheritance strategies that dictate how subclasses are mapped to database tables. The three strategies are single table per class hierarchy, joined subclass, and single table per class.聽

2.聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 What is the primary purpose of the javax.xml.ws.Provider API?

b.聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 Allows web services to work directly with messages. The JAX-WS 2.0 specification provides two new APIs which make it possible for web services to work with messages or message payloads. The APIs are javax.xml.ws.Provider and java.xml.ws.Dispatch . Provider is a server-side API, while Dispatch is a client-side API.聽

3.聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 Which of the following statements about the ELResolver class is true?

d.聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 All of the above. For more about the ELResolver class, especially how to create a customized ELResolver .

4. What does the <service-name-pattern> element in the following set of XML statements do:聽
聽聽聽聽聽聽聽聽聽聽聽 <handler-chains xmlns="http://java.sun.com/xml/ns/javaee"> 聽聽聽聽聽聽聽
聽聽聽聽聽聽聽聽聽聽聽聽<handler-chain>
聽聽聽聽聽聽
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 <service-name-pattern聽

聽聽聽聽
聽聽聽聽聽聽聽聽聽聽聽聽聽聽xmlns:ns1="http://example.com/handlers">聽聽聽聽聽
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 ns1:HelloService

聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 </service-name-pattern>聽聽

聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 <handler/>聽聽
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 <handler/>

聽聽聽聽
聽聽聽聽聽聽聽聽聽聽聽聽 </handler-chain>
聽聽聽聽
聽聽聽聽聽聽 </handler-chains>
聽聽聽聽
e.聽聽聽聽聽聽 Applies the handlers in the specified in the <handler-chain>element to the service with the Java EE qname {http://example.com/handlers}HelloService. The <service-name-pattern>element applies handlers to specific services. Handlers are interceptors that can be easily plugged into the JAX-WS 2.0 runtime environment to do additional processing of inbound and outbound messages. A handler chain is an ordered list of handlers that is used for configuring handlers. .

5.What role does an XMLHttpRequest object play in an AJAX-enabled application?

聽 c.聽聽聽聽聽 It's used to transmit AJAX requests asynchronously over HTTP to a server-side component. An XMLHttpRequest object plays a central role in the AJAX methodology as the means of interaction between the client and server-side component that processes AJAX requests.聽



Sun River 2006-11-27 09:26 鍙戣〃璇勮
]]>
2006-11-26http://www.aygfsteel.com/SunRiver/archive/2006/11/27/83694.htmlSun RiverSun RiverMon, 27 Nov 2006 00:00:00 GMThttp://www.aygfsteel.com/SunRiver/archive/2006/11/27/83694.htmlhttp://www.aygfsteel.com/SunRiver/comments/83694.htmlhttp://www.aygfsteel.com/SunRiver/archive/2006/11/27/83694.html#Feedback0http://www.aygfsteel.com/SunRiver/comments/commentRss/83694.htmlhttp://www.aygfsteel.com/SunRiver/services/trackbacks/83694.html闃呰鍏ㄦ枃

Sun River 2006-11-27 08:00 鍙戣〃璇勮
]]>
2006-11-26http://www.aygfsteel.com/SunRiver/archive/2006/11/27/83692.htmlSun RiverSun RiverSun, 26 Nov 2006 21:26:00 GMThttp://www.aygfsteel.com/SunRiver/archive/2006/11/27/83692.htmlhttp://www.aygfsteel.com/SunRiver/comments/83692.htmlhttp://www.aygfsteel.com/SunRiver/archive/2006/11/27/83692.html#Feedback0http://www.aygfsteel.com/SunRiver/comments/commentRss/83692.htmlhttp://www.aygfsteel.com/SunRiver/services/trackbacks/83692.htmlProcessing (parsing) XML documents using:聽
聽聽聽- Document Object Model (DOM)
聽聽聽- Simple API for XML (SAX)
聽聽聽Transforming XML documents using聽
聽聽聽-
XSL/XSLT
聽聽聽-聽XPath
2).

Steps for DOM Parsing

1. Tell the system which parser you will use

2. Create a JAXP document builder

3. Invoke the parser to create a Document representing an XML

document

4. Normalize the tree

5. Obtain the root node of the tree

6. Examine and modify properties of the node


3).

Steps for SAX Parsing

1. Tell the system which parser you want to use

2. Create a parser instance

3. Create a content handler to respond to parsing events

4. Invoke the parser with the designated content handler and

document



Sun River 2006-11-27 05:26 鍙戣〃璇勮
]]>
2006-11-26: Questions http://www.aygfsteel.com/SunRiver/archive/2006/11/27/83684.htmlSun RiverSun RiverSun, 26 Nov 2006 16:48:00 GMThttp://www.aygfsteel.com/SunRiver/archive/2006/11/27/83684.htmlhttp://www.aygfsteel.com/SunRiver/comments/83684.htmlhttp://www.aygfsteel.com/SunRiver/archive/2006/11/27/83684.html#Feedback0http://www.aygfsteel.com/SunRiver/comments/commentRss/83684.htmlhttp://www.aygfsteel.com/SunRiver/services/trackbacks/83684.html1). What is a document type definition and what is its purpose in XML? Explain the difference between a well-formed and a valid XML document.
Answer: The purpose of a DTD is to define the legal building blocks of an XML document. It defines the document structure with a list of legal elements. A DTD can be declared inline in your XML document, or as an external reference. Two definitions:
聽聽 -).A well-formed file is one that obeys the general XML rules for tags: tags must be properly nested, opening and closing tags must be balanced, and empty tags must end with '/>'.
聽聽 -). A valid file is not only well-formed, but it must also conform to a publicly available DTD that specifies which tags it uses, what attributes those tags can contain, and which tags can occur inside which other tags, among other properties.

2). External DTD:
<?xml version="1.0"?>
<!DOCTYPE note SYSTEM "note.dtd">

3). Minimal but Complete XSLTStylesheet

<?xml version="1.0"?>

聽聽 < xsl:stylesheet version="1.0"

聽聽聽聽聽聽聽聽聽聽聽 xmlns:xsl="http://www.w3.org/1999/ XSL/Transform">

< /xsl:stylesheet >

4). Using XSLT, how would you extract a specfic attribute from an element in an XML document?
Ans: Extract attributes from XML data
聽聽 <xsl:template match="element-name">
聽聽聽聽 Attribute Value:
聽聽聽聽聽聽聽 <xsl:value-of select="@attribute" />
聽聽聽聽聽聽聽聽 <xsl:apply-templates/>
聽聽聽 </xsl:template>

5). Templates--Controls which output is created from which input

--" xsl:template element form

--" match attribute contains an Xpath expression (Xpath expression identifies input node set it matches)

--" For each node in the node set, the

template contents (things between xsl:template tags) are instantiated and inserted into the output tree.

6). Attributes

In the DTD, XML element attributes are declared with an ATTLIST declaration. An attribute declaration has the following syntax:

<!ATTLIST element-name attribute-name attribute-type default-value>

As you can see from the syntax above, the ATTLIST declaration defines the element which can have the attribute, the name of the attribute, the type of the attribute, and the default attribute value.

The attribute-type can have the following values:

ValueExplanation
CDATA
The value is character data
(eval|eval|..)
The value must be an enumerated value
ID
The value is an unique id 
IDREF
The value is the id of another element
IDREFS
The value is a list of other ids
NMTOKEN
The value is a valid XML name
NMTOKENS
The value is a list of valid XML names
ENTITY
The value is an entity 
ENTITIES
The value is a list of entities
NOTATION
The value is a name of a notation
xml:
The value is predefined

The attribute-default-value can have the following values:

ValueExplanation
#DEFAULT value
The attribute has a default value
#REQUIRED
The attribute value must be included in the element
#IMPLIED
The attribute does not have to be included
#FIXED value
The attribute value is fixed


Attribute declaration example

DTD example:
<!ELEMENT square EMPTY>
  <!ATTLIST square width CDATA "0">

XML example:
<square width="100"></square>

In the above example the element square is defined to be an empty element with the attributes width of聽 type CDATA. The width attribute has a default value of 0.聽

Default attribute value

Syntax:
<!ATTLIST element-name attribute-name CDATA "default-value">

DTD example:
<!ATTLIST payment type CDATA "check">

XML example:
<payment type="check">

Specifying a default value for an attribute, assures that the attribute will get a value even if the author of the XML document didn't include it.

Implied attribute

Syntax:
<!ATTLIST element-name attribute-name attribute-type #IMPLIED>
DTD example:
<!ATTLIST contact fax CDATA #IMPLIED>

XML example:
<contact fax="555-667788">

Use an implied attribute if you don't want to force the author to include an attribute and you don't have an option for a default value either.聽

Required attribute

Syntax:
<!ATTLIST element-name attribute_name attribute-type #REQUIRED>
DTD example:
<!ATTLIST person number CDATA #REQUIRED>

XML example:
<person number="5677">

Use a required attribute if you don't have an option for a default value, but still want to force the attribute to be present.

Fixed attribute value

Syntax:
<!ATTLIST element-name attribute-name attribute-type #FIXED "value">
DTD example:
<!ATTLIST sender company CDATA #FIXED "Microsoft">


XML example:
<sender company="Microsoft">

Use a fixed attribute value when you want an attribute to have a fixed value without allowing the author to change it. If an author includes another value, the XML parser will return an error.

Enumerated attribute values

Syntax:
<!ATTLIST element-name attribute-name (eval|eval|..) default-value>
DTD example:
<!ATTLIST payment type (check|cash) "cash">

XML example:
<payment type="check">
or
<payment type="cash">


Sun River 2006-11-27 00:48 鍙戣〃璇勮
]]>
主站蜘蛛池模板: 四川省| 申扎县| 共和县| 环江| 汾阳市| 荔波县| 阿瓦提县| 怀柔区| 阳原县| 丘北县| 中山市| 定南县| 巴林左旗| 云龙县| 邹平县| 嘉峪关市| 丽江市| 勃利县| 边坝县| 奉化市| 望谟县| 疏勒县| 金华市| 双峰县| 喀什市| 阳高县| 邹城市| 铜梁县| 东丽区| 孟连| 沙田区| 新闻| 乌苏市| 邢台市| 青铜峡市| 仁寿县| 灵山县| 洛阳市| 丰镇市| 独山县| 西峡县|