JWorld@TW the best professional Java site in Taiwan
      註冊 | 登入 | 全文檢索 | 排行榜  

» JWorld@TW » Java Certification » SCWCD  

按列印兼容模式列印這個話題 列印話題    把這個話題寄給朋友 寄給朋友    訂閱主題
reply to topicthreaded modego to previous topicgo to next topic
本主題所含的標籤
無標籤
作者 121~130(9題) [Re:swanky]
swanky

暴走熊

版主

發文: 461
積分: 9
於 2003-11-16 16:49 user profilesend a private message to usersend email to swankyreply to postreply to postsearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
QUESTION NO: 121
Which two are true about the HTTP POST method? (Choose two)
A. POST requests are faster.
B. It supports multipart MIME requests.
C. Request data is sent in a separate content block.
D. Parameters are accessible using the getQueryString method of the
HttpServletRequest interface.
--
QUESTION NO: 122
Which element name in the Web application deployment descriptor is used to declare that a
custom tag library can be used by the JSP pages in that Web application?
A. tag
B. taglib
C. tag-lib
D. taglibrary
E. tag-library
--
QUESTION NO: 124
Given a tag library with the following tag:
a tag called getYoshi that has one attribute called hierarchy that is not mandatory.
Which two options are a valid use of this tag in a JSP page? (Choose two)
A. <mT:getYoshi>
B. </mT:getYoshi>
C. <mT:getYoshi></mT:getYoshi>
D. <mT:getYoshi hierarchy="vol1,chap1">
E. </mT:getYoshi hierarchy="vol1,chap1">
F. <mT:getYoshi hierarchy="vol1,chap1"/>
--
QUESTION NO: 125
Which three constants describe the body content of a JSP custom tag in a tag library
descriptor? (Choose three)
A. JSP
B. none
C. empty
D. tei-class
E. tagdependent
--
QUESTION NO: 126
What is the meaning of the SKIP_PAGE constant when it is returned from the doEndTag method?
A. SKIP_PAGE is not a valid return value for the doEndTag method.
B. SKIP_PAGE directs the JSP page to disregard the body of the custom tag.
C. SKIP_PAGE directs the JSP page to disregard the rest of the JSP page content.
D. SKIP_PAGE directs the JSP page to disregard any included JSP fragments from the jsp:include standard action.
--
QUESTION NO: 127
Given:
1. <html>
2. <body>
3. <%
4. for(int i = 0; 1 < 10; i++) {
5.
6. }
7. %>
8. </body>
9. </html>

Which can appear at line 5 without causing an error?
A. <%= i %>
B. <b>i</b>
C. %><%= i %><%
D. <h1>Hello</h1>
--
QUESTION NO: 128
Given:
3. <a:tagX attr="123">
4. <a:tagY>
5. <a:tagZ/>
6. </a:tagY>
7. </a:tagX>
Which TagSupport method can be used by the tagZ handler class to access the tagX handler?
A. getParent
B. findAncestor
C. getParentWithClass
D. findAncestorWithClass
--
QUESTION NO: 129
Given a tag that iterates over a set of values, which static value from the
javax.servlet.jsp.tagext.Tag interface must be returned from the doAfterBody
method to end the iteration?
Note: Do not specify the interface name in your response.
--
QUESTION NO: 130
Which tag library descriptor element name identifies the type of body content for a JSP custom tag?
A. JSP
B. Body
C. content
D. body-content


reply to postreply to post
作者 Re:121~130(9題) 解答 [Re:swanky]
swanky

暴走熊

版主

發文: 461
積分: 9
於 2003-11-16 16:57 user profilesend a private message to usersend email to swankyreply to postreply to postsearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list

QUESTION NO: 121
Which two are true about the HTTP POST method? (Choose two)
A. POST requests are faster.
B. It supports multipart MIME requests.
C. Request data is sent in a separate content block.
D. Parameters are accessible using the getQueryString method of the
HttpServletRequest interface.

Answer: BC

QUESTION NO: 122
Which element name in the Web application deployment descriptor is used to declare that a
custom tag library can be used by the JSP pages in that Web application?
A. tag
B. taglib
C. tag-lib
D. taglibrary
E. tag-library

Answer: B

QUESTION NO: 124
Given a tag library with the following tag:
a tag called getYoshi that has one attribute called hierarchy that is not mandatory.
Which two options are a valid use of this tag in a JSP page? (Choose two)
A. <mT:getYoshi>
B. </mT:getYoshi>
C. <mT:getYoshi></mT:getYoshi>
D. <mT:getYoshi hierarchy="vol1,chap1">
E. </mT:getYoshi hierarchy="vol1,chap1">
F. <mT:getYoshi hierarchy="vol1,chap1"/>

Answer: CF

QUESTION NO: 125
Which three constants describe the body content of a JSP custom tag in a tag library
descriptor? (Choose three)
A. JSP
B. none
C. empty
D. tei-class
E. tagdependent

Answer: ACE

QUESTION NO: 126
What is the meaning of the SKIP_PAGE constant when it is returned from the doEndTag method?
A. SKIP_PAGE is not a valid return value for the doEndTag method.
B. SKIP_PAGE directs the JSP page to disregard the body of the custom tag.
C. SKIP_PAGE directs the JSP page to disregard the rest of the JSP page content.
D. SKIP_PAGE directs the JSP page to disregard any included JSP fragments from the jsp:include standard action.

Answer: C

QUESTION NO: 127
Given:
1. <html>
2. <body>
3. <%
4. for(int i = 0; 1 < 10; i++) {
5.
6. }
7. %>
8. </body>
9. </html>

Which can appear at line 5 without causing an error?
A. <%= i %>
B. <b>i</b>
C. %><%= i %><%
D. <h1>Hello</h1>

Answer: C

QUESTION NO: 128
Given:
3. <a:tagX attr="123">
4. <a:tagY>
5. <a:tagZ/>
6. </a:tagY>
7. </a:tagX>
Which TagSupport method can be used by the tagZ handler class to access the tagX handler?
A. getParent
B. findAncestor
C. getParentWithClass
D. findAncestorWithClass

Answer: D

QUESTION NO: 129
Given a tag that iterates over a set of values, which static value from the
javax.servlet.jsp.tagext.Tag interface must be returned from the doAfterBody
method to end the iteration?
Note: Do not specify the interface name in your response.

Answer: SKIP_BODY

QUESTION NO: 130
Which tag library descriptor element name identifies the type of body content for a JSP custom tag?
A. JSP
B. Body
C. content
D. body-content

Answer: D


reply to postreply to post
作者 131~140(9題) [Re:swanky]
swanky

暴走熊

版主

發文: 461
積分: 9
於 2003-11-16 17:04 user profilesend a private message to usersend email to swankyreply to postreply to postsearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
QUESTION NO: 131
Given:
1. public class Yo***ag extends BodyTagSupport { // 註: jute 不讓我打 Yoshi-Tag
2. public int doAfterBody() throws JspException {
3. Object obj = pageContext.getAttribute("anObject");
4. return 2;
5. }
6. }
Assuming that the Object reference returned in line 3 is not null, in what scope does that
object reside?
A. page
B. session
C. request
D. application
--
QUESTION NO: 132
What is the name of the tag library descriptor element that declares the name of a tag?
--
QUESTION NO: 133

How many times can the doEndTag method be called when processing a custom tag handler in
a JSP page?
A. Only one, regardless of the return value of the doStartTag method.
B. Zero or one, depending on the return value of the doStartTag method.
C. One or more, depending on the return value of the doStartTag method.
D. Zero or more, regardless of the return value of the doStartTag method.
--
QUESTION NO: 134
Given servlet A:
1. public class A extends HttpServlet {
2. public void doPost( HttpServletRequest req, HttpServletResponse resp) throws ServletException {
3. String id = "yoshi";
4.
5. }
6. }
Servlet A and servlet B share the same active session.
Which, inserted at line 4, will allow servlet B to access the value "yoshi" in subsequent
POST requests to servlet B?
A. req.getSession().put("ID",id);
B. req.getSession().setValue("ID"),id)
C. req.getSession().putAttribute("ID",id);
D. req.getSession().setAttribute("ID",id);
--
QUESTION NO: 136
Which interface must a class implement so that instances of that class will be notified when they are added as attributes of an HTTP session?
A. java.util.EventListener
B. javax.servlet.http.HttpSessionListener
C. javax.servlet.http.HttpSessionValueListener
D. javax.servlet.http.HttpSessionBindingListener
--
QUESTION NO: 137
Given:
11. public class Yoshi extends HttpServlet {
12. public void doPost(HttpServletRequest req, HttpServletResponse resp) {
13.
14. }
15. }
Assume that no other servlets participating in the same session as servlet Yoshi explicitly invalidates the session.
Which, inserted at line 13, will ensure that the session remains valid for at least six minutes?
A. req.getSession().setTimeout(6);
B. req.getSession().setTimeout(360);
C. Nothing can be inserted to ensure the given condition.
D. req.getSession().setMaxInactiveInterval(6);
E. req.getSession().setMaxInactiveInterval(360);
--
QUESTION NO: 138
Which declares the current JSP page to be an error page?
A. <%@ page info="error" %>
B. <%@ page errorPage="true" %>
C. <%@ page isErrorPage="true" %>
D. <%@ page pageEndcoding="error" %>
E. <%@ page extends="javax.servlet.jsp.JspErrorPage" %>
--
QUESTION NO: 139
Given:
11. public class Acc1 extends HttpServlet implements SingleThreadModel {
12. private StringBuffer bar = new StringBuffer("bar");
13. private static StringBuffer xyz = new StringBuffer();
14. public void doPost(HttpServletRequest req, HttpServletResponse resp) {
15. StringBuffer yoshi = new StringBuffer("yoshi");
16. HttpSession session = req.getSession():
17. }
18. }
Which three variables reference objects are thread-safe? (Choose three)
A. bar at line 12.
B. xyz at line 13.
C. yoshi at line 15.
D. req at line 14.
E. session at line 16.
--
QUESTION NO: 140
If a servlet is designed to execute in single-threaded mode as part of a distributed Web application, which is true?
A. The servlet container must only instantiate one instance of the servlet within each Java Virtual Machine.
B. The servlet definition in the Web application deployment descriptor must include the <distributable/> element.
C. The servlet container may instantiate multiple instances of that servlet in each Java Virtual Machine within the container.
D. The servlet container manages the thread-safety of the session object within each of the Java Virtual Machines in the distributed application.


reply to postreply to post
作者 Re:131~140(9題) 解答 [Re:swanky]
swanky

暴走熊

版主

發文: 461
積分: 9
於 2003-11-16 17:12 user profilesend a private message to usersend email to swankyreply to postreply to postsearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list

QUESTION NO: 131
Given:
1. public class Yo***ag extends BodyTagSupport { // 註: jute 不讓我打 Yoshi-Tag
2. public int doAfterBody() throws JspException {
3. Object obj = pageContext.getAttribute("anObject");
4. return 2;
5. }
6. }
Assuming that the Object reference returned in line 3 is not null, in what scope does that
object reside?
A. page
B. session
C. request
D. application

Answer: A

getAttribute 的 API:

public abstract java.lang.Object getAttribute(java.lang.String name)

return the object associated with the name in the page scope or null

Parameters:
name - the name of the attribute to get
Throws:
NullPointerException - if the name is null
java.lang.IllegalArgumentException - if the scope is invalid


QUESTION NO: 132
What is the name of the tag library descriptor element that declares the name of a tag?

Answer: <name>

QUESTION NO: 133

How many times can the doEndTag method be called when processing a custom tag handler in
a JSP page?
A. Only one, regardless of the return value of the doStartTag method.
B. Zero or one, depending on the return value of the doStartTag method.
C. One or more, depending on the return value of the doStartTag method.
D. Zero or more, regardless of the return value of the doStartTag method.

Answer: A

QUESTION NO: 134
Given servlet A:
1. public class A extends HttpServlet {
2. public void doPost( HttpServletRequest req, HttpServletResponse resp) throws ServletException {
3. String id = "yoshi";
4.
5. }
6. }
Servlet A and servlet B share the same active session.
Which, inserted at line 4, will allow servlet B to access the value "yoshi" in subsequent
POST requests to servlet B?
A. req.getSession().put("ID",id);
B. req.getSession().setValue("ID"),id)
C. req.getSession().putAttribute("ID",id);
D. req.getSession().setAttribute("ID",id);

Answer: D

QUESTION NO: 136
Which interface must a class implement so that instances of that class will be notified when they are added as attributes of an HTTP session?
A. java.util.EventListener
B. javax.servlet.http.HttpSessionListener
C. javax.servlet.http.HttpSessionValueListener
D. javax.servlet.http.HttpSessionBindingListener

Answer: D

QUESTION NO: 137
Given:
11. public class Yoshi extends HttpServlet {
12. public void doPost(HttpServletRequest req, HttpServletResponse resp) {
13.
14. }
15. }
Assume that no other servlets participating in the same session as servlet Yoshi explicitly invalidates the session.
Which, inserted at line 13, will ensure that the session remains valid for at least six minutes?
A. req.getSession().setTimeout(6);
B. req.getSession().setTimeout(360);
C. Nothing can be inserted to ensure the given condition.
D. req.getSession().setMaxInactiveInterval(6);
E. req.getSession().setMaxInactiveInterval(360);

Answer: E

QUESTION NO: 138
Which declares the current JSP page to be an error page?
A. <%@ page info="error" %>
B. <%@ page errorPage="true" %>
C. <%@ page isErrorPage="true" %>
D. <%@ page pageEndcoding="error" %>
E. <%@ page extends="javax.servlet.jsp.JspErrorPage" %>

Answer: C

QUESTION NO: 139
Given:
11. public class Acc1 extends HttpServlet implements SingleThreadModel {
12. private StringBuffer bar = new StringBuffer("bar");
13. private static StringBuffer xyz = new StringBuffer();
14. public void doPost(HttpServletRequest req, HttpServletResponse resp) {
15. StringBuffer yoshi = new StringBuffer("yoshi");
16. HttpSession session = req.getSession():
17. }
18. }
Which three variables reference objects are thread-safe? (Choose three)
A. bar at line 12.
B. xyz at line 13.
C. yoshi at line 15.
D. req at line 14.
E. session at line 16.

Answer: ACD

QUESTION NO: 140
If a servlet is designed to execute in single-threaded mode as part of a distributed Web application, which is true?
A. The servlet container must only instantiate one instance of the servlet within each Java Virtual Machine.
B. The servlet definition in the Web application deployment descriptor must include the <distributable/> element.
C. The servlet container may instantiate multiple instances of that servlet in each Java Virtual Machine within the container.
D. The servlet container manages the thread-safety of the session object within each of the Java Virtual Machines in the distributed application.

Answer: C


reply to postreply to post
作者 141~150(9題) [Re:swanky]
swanky

暴走熊

版主

發文: 461
積分: 9
於 2003-11-16 17:17 user profilesend a private message to usersend email to swankyreply to postreply to postsearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
QUESTION NO: 142
You are developing a Web application to provide inventory management for a wine store. The
application will require an Inventory class, to manage the whole store inventory, and an
InventoryItems class, to represent the specific information about an item in the inventory.
The InventoryItem class has the following goals:
- The information in an InventoryItem object is immutable.
- The inventory data is stored in a remote server.
- The InventoryItem will be referenced multiple times in the same JSP.

Which design pattern matches the goals of the InventoryItem class?
A. Facade
B. Value Object
C. Front Component
D. Model-View-Controller
--
QUESTION NO: 143
Which J2EE design pattern unifies and simplifies workflow by interpreting user request and
dispatching screen from a single point?
A. Value Object
B. Front Component
C. Data Access Object
D. Model-View-Controller
E. Session Entity Facade
--
QUESTION NO: 144
As a programmer at Yoshi Inc you are developing a Web application that must load
information from several different sources, including databases and XML files.
Which design pattern is intended to support this functionality?
A. Value Object
B. Front Component
C. Template Method
D. Data Access Object
--
QUESTION NO: 145
Which J2EE design pattern provides flexible, extensible access to data and other resources?
A. Value Object
B. Front Component
C. Data Access Object
D. Bimodal Data Access
E. Session Entity Facade
--
QUESTION NO: 146
Given this code from the doGet method, where response is an HttpServletResponse:
12. response.setStatus(HttpServletResponse.SC_MOVED_TEMPORARILY);
13. response.setHeader("Location", "http://www.yoshi.com");
Which is equivalent?
A. response.forward("http://www.yoshi.com");
B. response.include("http://www.yoshi.com");
C. response.redirect("http://www.yoshi.com");
D. response.setLocation("http://www.yoshi.com");
E. response.sendRedirect("http://www.yoshi.com");
--
QUESTION NO: 147
Given:
1. public class ServletYoshi extends HttpServlet {
2. public void doGet(HttpServletRequest request,
3. HttpServletResponse response)
4. throws ServletException, IOException
5. {
6. try {
7. Integer.parseInt("one");
8. } catch(Exception e) {
9. String message = "Caught exception";
10.
11. }
12. }
13. }
Which two, inserted individually at line 10, will place a descriptive message and the stack trace
of the caught exception in the servlet log file? (Choose two)
A. log(message, e);
B. request.log(message, e);
C. getServletInfo().log(message, e);
D. getServletConfig().log(message, e);
E. getServletContext().log(message, e);
F. request.getSession().log(message, e);
--
QUESTION NO: 148
Which two represent valid JSP expressions? (Choose two)
A. <% x %>
B. <%= Math.random() %>
C. <%= "YOSHI" + "EXAMINATOR" %>
D. <%= Math.random(); %>
E. <% int x = "4" + "2"; %>
F. <% String x = "4" + "2" %>
--
QUESTION NO: 149
Which event is received by the appropriate listeners when a servlet context is first created?
A. javax.servlet.ServletContextEvent
B. javax.servlet.ServletCreatedEvent
C. javax.servlet.ServletInitializedEvent
D. javax.servlet.http.HttpServletContextEvent
E. javax.servlet.http.HttpServletInitializedEvent
--
QUESTION NO: 150
Within a Web application deployment descriptor, which specifies an
HttpSessionActivationListener implemented by the class wcd.http.ActivationListener?
A. <listener>
wcd.http.ActivationListener
</listener>
B. <listener>
<class>wcd.http.ActavationListener</class>
</listener>
C. <attr-listener>
<class>wcd.http.ActivationListener</class>
</attr-listener>
D. <listener>
<listener-class>
wcd.http.ActicationListener
</listener-class>
</listener>
E. <session-listener>
<listener-class>
wcd.http.ActivationListener
</listener-class>
</session-listener>


reply to postreply to post
作者 Re:141~150(9題) 解答 [Re:swanky]
swanky

暴走熊

版主

發文: 461
積分: 9
於 2003-11-16 17:21 user profilesend a private message to usersend email to swankyreply to postreply to postsearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list

QUESTION NO: 142
You are developing a Web application to provide inventory management for a wine store. The
application will require an Inventory class, to manage the whole store inventory, and an
InventoryItems class, to represent the specific information about an item in the inventory.
The InventoryItem class has the following goals:
- The information in an InventoryItem object is immutable.
- The inventory data is stored in a remote server.
- The InventoryItem will be referenced multiple times in the same JSP.

Which design pattern matches the goals of the InventoryItem class?
A. Facade
B. Value Object
C. Front Component
D. Model-View-Controller

Answer: B

QUESTION NO: 143
Which J2EE design pattern unifies and simplifies workflow by interpreting user request and
dispatching screen from a single point?
A. Value Object
B. Front Component
C. Data Access Object
D. Model-View-Controller
E. Session Entity Facade

Answer: B (or D)

QUESTION NO: 144
As a programmer at Yoshi Inc you are developing a Web application that must load
information from several different sources, including databases and XML files.
Which design pattern is intended to support this functionality?
A. Value Object
B. Front Component
C. Template Method
D. Data Access Object

Answer: D

QUESTION NO: 145
Which J2EE design pattern provides flexible, extensible access to data and other resources?
A. Value Object
B. Front Component
C. Data Access Object
D. Bimodal Data Access
E. Session Entity Facade

Answer: C

QUESTION NO: 146
Given this code from the doGet method, where response is an HttpServletResponse:
12. response.setStatus(HttpServletResponse.SC_MOVED_TEMPORARILY);
13. response.setHeader("Location", "http://www.yoshi.com");
Which is equivalent?
A. response.forward("http://www.yoshi.com");
B. response.include("http://www.yoshi.com");
C. response.redirect("http://www.yoshi.com");
D. response.setLocation("http://www.yoshi.com");
E. response.sendRedirect("http://www.yoshi.com");

Answer: E

QUESTION NO: 147
Given:
1. public class ServletYoshi extends HttpServlet {
2. public void doGet(HttpServletRequest request,
3. HttpServletResponse response)
4. throws ServletException, IOException
5. {
6. try {
7. Integer.parseInt("one");
8. } catch(Exception e) {
9. String message = "Caught exception";
10.
11. }
12. }
13. }
Which two, inserted individually at line 10, will place a descriptive message and the stack trace
of the caught exception in the servlet log file? (Choose two)
A. log(message, e);
B. request.log(message, e);
C. getServletInfo().log(message, e);
D. getServletConfig().log(message, e);
E. getServletContext().log(message, e);
F. request.getSession().log(message, e);

Answer: AE

QUESTION NO: 148
Which two represent valid JSP expressions? (Choose two)
A. <% x %>
B. <%= Math.random() %>
C. <%= "YOSHI" + "EXAMINATOR" %>
D. <%= Math.random(); %>
E. <% int x = "4" + "2"; %>
F. <% String x = "4" + "2" %>

Answer: BC

QUESTION NO: 149
Which event is received by the appropriate listeners when a servlet context is first created?
A. javax.servlet.ServletContextEvent
B. javax.servlet.ServletCreatedEvent
C. javax.servlet.ServletInitializedEvent
D. javax.servlet.http.HttpServletContextEvent
E. javax.servlet.http.HttpServletInitializedEvent

Answer: A

QUESTION NO: 150
Within a Web application deployment descriptor, which specifies an
HttpSessionActivationListener implemented by the class wcd.http.ActivationListener?
A. <listener>
wcd.http.ActivationListener
</listener>
B. <listener>
<class>wcd.http.ActavationListener</class>
</listener>
C. <attr-listener>
<class>wcd.http.ActivationListener</class>
</attr-listener>
D. <listener>
<listener-class>
wcd.http.ActicationListener
</listener-class>
</listener>
E. <session-listener>
<listener-class>
wcd.http.ActivationListener
</listener-class>
</session-listener>

Answer: D


reply to postreply to post
作者 151~162(12題) [Re:swanky]
swanky

暴走熊

版主

發文: 461
積分: 9
於 2003-11-16 17:24 user profilesend a private message to usersend email to swankyreply to postreply to postsearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
QUESTION NO: 151
What single method is defined by javax.servlet.http.HttpSessionEvent?
Note: Provide only the method name; for example, yoshi NOT yoshi().
--
QUESTION NO: 152
Given this fragment from a Web application deployment descriptor?
12. <context-param>
13. <param-name>user</param-name>
14. <param-value>yoshi</param-value>
15. </context-param>
From within a servlet's doPost method, which retrieves the value of the user parameter?
A. getServletConfig().getAttribute("user");
B. getServletContext().getAttribute("user");
C. getServletConfig().getInitParameter("user");
D. getServletContext().getInitParameter("user");
--
QUESTION NO: 153
What is true regarding a session within a distributed Web application?
A. URL rewriting may not be used when redirecting responses.
B. Attributes in the session object CANNOT be shared between servlet contexts.
C. An instance of HttpSessionActivationListener must be defined for each Java VM
in the servlet container.
D. Object attributes in the session object must implement the
HttpSessionActivationListener interface.
--
QUESTION NO: 154
Given the JSP page, yoshi.jsp:
1. <html>
2. <jsp:include page="abc.jsp">
3. <jsp:param name="subTitle" value="Registration Form"/>
4. </jsp:include>
5. </html>
Which would you use in the abc.jsp fragment to produce the HTML response?
<h3>Registration Form</h3>
A. <h3><jsp:getParam name="subTitle"/></h3>
B. <h3><jsp:include param="subTitle"/></h3>
C. <h3><%= request.getParameter("subTitle") %></h3>
D. <h3><%= request.getAttribute("subTitle") %></h3>
--
QUESTION NO: 155
Which correctly defines authentication?
A. Authentication identifies a user and verifies the user's passphrase.
B. Authentication protects the Web server from denial-of-service attacks.
C. Authentication uses the user's passphrase to encrypt the TCP stream.
D. Authentication verifies that a user has access to a specific resource on the Web server.
--
QUESTION NO: 156
Which two API techniques can be used to get the name of an authenticated user? (Choose two)
A. Use the getUser on the HTTP servlet request object.
B. Use the getUserName on the HTTP servlet request object.
C. Use the getRemoteUser on the HTTP servlet request object.
D. Retrieve the principal object from the HTTP servlet request object using getUser and use the getName on the principal object.
E. Retrieve the principal object from the HTTP servlet request object using getPricipal and use the getName on the principal object.
--
QUESTION NO: 157
Which deployment descriptor elements are used to configure Web services for authorization?
A. security-constraint, login-form, realm-name
B. security-constraint, login-config, security-role
C. web-resource-constraint, login-form, security-role
D. web-resource-constraint, login-config, security-role
--
QUESTION NO: 158
Your Web application requires that an authenticated request guarantee that the
ServletRequest method isSecure returns true.
Which value of the auth-method deployment descriptor will cause this behavior?
A. HTTPS
B. DIGEST
C. CLIENT-CERT
D. CERTIFICATE
--
QUESTION NO: 159
Which will print the value of the Accept-Charset HTTP header in a JSP page?
A. <%= headers.get("Accept-Charset") %>
B. <%= page.getHeader("Accept-Charset") %>
C. <%= headers.getValue("Accept-Charset") %>
D. <%= request.getHeader("Accept-Charset") %>
--
QUESTION NO: 160
Which includes a file in a JSP page at request time?
A. <%@ include file="yoshi.html" %>
B. <%@ include page="yoshi.html" %>
C. <%@ page include="yoshi.html" %>
D. <jsp:include file="yoshi.html" />
E. <jsp:include page="yoshi.html" flush="true" />
--
QUESTION NO: 161
Which two set the content type of a JSP page? (Choose two)
A. <%@ contentType "text/plain" %>
B. <jsp:contentType "text/plain">
C. <%@ page contentType="text/plain" %>
D. <% session.setContentType("text/plain"); %>
E. <% request.setContentType("text/plain"); %>
F. <% response.setContentType("text/plain"); %>
--
QUESTION NO: 162
Which attribute and value of the jsp:setProperty action causes a JSP page to iterate over all ServletRequest parameters and assign values of the corresponding properties in a JavaBean?
Note: Type the attribute and value exactly as they would appear within the
jsp:setProperty element. Do not type any other part of the jsp:setProperty element.


reply to postreply to post
作者 Re:151~162(12題) 解答 [Re:swanky]
swanky

暴走熊

版主

發文: 461
積分: 9
於 2003-11-16 17:28 user profilesend a private message to usersend email to swankyreply to postreply to postsearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list

QUESTION NO: 151
What single method is defined by javax.servlet.http.HttpSessionEvent?
Note: Provide only the method name; for example, yoshi NOT yoshi().

Answer: getSession

QUESTION NO: 152
Given this fragment from a Web application deployment descriptor?
12. <context-param>
13. <param-name>user</param-name>
14. <param-value>yoshi</param-value>
15. </context-param>
From within a servlet's doPost method, which retrieves the value of the user parameter?
A. getServletConfig().getAttribute("user");
B. getServletContext().getAttribute("user");
C. getServletConfig().getInitParameter("user");
D. getServletContext().getInitParameter("user");

Answer: D

QUESTION NO: 153
What is true regarding a session within a distributed Web application?
A. URL rewriting may not be used when redirecting responses.
B. Attributes in the session object CANNOT be shared between servlet contexts.
C. An instance of HttpSessionActivationListener must be defined for each Java VM
in the servlet container.
D. Object attributes in the session object must implement the
HttpSessionActivationListener interface.

Answer: B

QUESTION NO: 154
Given the JSP page, yoshi.jsp:
1. <html>
2. <jsp:include page="abc.jsp">
3. <jsp:param name="subTitle" value="Registration Form"/>
4. </jsp:include>
5. </html>
Which would you use in the abc.jsp fragment to produce the HTML response?
<h3>Registration Form</h3>
A. <h3><jsp:getParam name="subTitle"/></h3>
B. <h3><jsp:include param="subTitle"/></h3>
C. <h3><%= request.getParameter("subTitle") %></h3>
D. <h3><%= request.getAttribute("subTitle") %></h3>

Answer: C

QUESTION NO: 155
Which correctly defines authentication?
A. Authentication identifies a user and verifies the user's passphrase.
B. Authentication protects the Web server from denial-of-service attacks.
C. Authentication uses the user's passphrase to encrypt the TCP stream.
D. Authentication verifies that a user has access to a specific resource on the Web server.

Answer: A

QUESTION NO: 156
Which two API techniques can be used to get the name of an authenticated user? (Choose two)
A. Use the getUser on the HTTP servlet request object.
B. Use the getUserName on the HTTP servlet request object.
C. Use the getRemoteUser on the HTTP servlet request object.
D. Retrieve the principal object from the HTTP servlet request object using getUser and use the getName on the principal object.
E. Retrieve the principal object from the HTTP servlet request object using getPricipal and use the getName on the principal object.

Answer: CE

QUESTION NO: 157
Which deployment descriptor elements are used to configure Web services for authorization?
A. security-constraint, login-form, realm-name
B. security-constraint, login-config, security-role
C. web-resource-constraint, login-form, security-role
D. web-resource-constraint, login-config, security-role

Answer: B

QUESTION NO: 158
Your Web application requires that an authenticated request guarantee that the
ServletRequest method isSecure returns true.
Which value of the auth-method deployment descriptor will cause this behavior?
A. HTTPS
B. DIGEST
C. CLIENT-CERT
D. CERTIFICATE

Answer: C

QUESTION NO: 159
Which will print the value of the Accept-Charset HTTP header in a JSP page?
A. <%= headers.get("Accept-Charset") %>
B. <%= page.getHeader("Accept-Charset") %>
C. <%= headers.getValue("Accept-Charset") %>
D. <%= request.getHeader("Accept-Charset") %>

Answer: D

QUESTION NO: 160
Which includes a file in a JSP page at request time?
A. <%@ include file="yoshi.html" %>
B. <%@ include page="yoshi.html" %>
C. <%@ page include="yoshi.html" %>
D. <jsp:include file="yoshi.html" />
E. <jsp:include page="yoshi.html" flush="true" />

Answer: E

QUESTION NO: 161
Which two set the content type of a JSP page? (Choose two)
A. <%@ contentType "text/plain" %>
B. <jsp:contentType "text/plain">
C. <%@ page contentType="text/plain" %>
D. <% session.setContentType("text/plain"); %>
E. <% request.setContentType("text/plain"); %>
F. <% response.setContentType("text/plain"); %>

Answer: CF

QUESTION NO: 162
Which attribute and value of the jsp:setProperty action causes a JSP page to iterate over all ServletRequest parameters and assign values of the corresponding properties in a JavaBean?
Note: Type the attribute and value exactly as they would appear within the
jsp:setProperty element. Do not type any other part of the jsp:setProperty element.

Answer: <jsp:setProperty name="address" property="*" />


swanky edited on 2004-01-03 19:55
reply to postreply to post
作者 Re:101~110(7題) 解答 [Re:swanky]
batpig





發文: 3
積分: 0
於 2004-04-08 22:57 user profilesend a private message to userreply to postreply to postsearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
QUESTION NO: 110
Which two are true about Web application archive files? (Choose two)
A. They must NOT be signed.
B. They may contain JAR files.
C. They must have a ".web" extension.
D. They may serve files from the META-INF directory.
E. They may contain JSP files in addition to HTML files.
F. They CANNOT define their dependencies in the manifest.mf file.

Answer: D.E

我看到有同樣題目,但答案是B.D,有人可以解答一下嗎??
謝謝


reply to postreply to post
作者 Re:101~110(7題) 解答 [Re:batpig]
swanky

暴走熊

版主

發文: 461
積分: 9
於 2004-04-08 23:19 user profilesend a private message to usersend email to swankyreply to postreply to postsearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
batpig wrote:
QUESTION NO: 110
Which two are true about Web application archive files? (Choose two)
A. They must NOT be signed.
B. They may contain JAR files.
C. They must have a ".web" extension.
D. They may serve files from the META-INF directory.
E. They may contain JSP files in addition to HTML files.
F. They CANNOT define their dependencies in the manifest.mf file.

Answer: D.E

我看到有同樣題目,但答案是B.D,有人可以解答一下嗎??
謝謝

其實我覺得B.D.E都沒有錯
題目可能要改成選三個~


reply to postreply to post
作者 Re:101~110(7題) 解答 [Re:batpig]
frankyilee

賤兔玩星海...



發文: 60
積分: 1
於 2004-04-11 13:49 user profilesend a private message to userreply to postreply to postsearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
batpig wrote:
QUESTION NO: 110
Which two are true about Web application archive files? (Choose two)
A. They must NOT be signed.
B. They may contain JAR files.
C. They must have a ".web" extension.
D. They may serve files from the META-INF directory.
E. They may contain JSP files in addition to HTML files.
F. They CANNOT define their dependencies in the manifest.mf file.

Answer: D.E

我看到有同樣題目,但答案是B.D,有人可以解答一下嗎??
謝謝


這題我記得以前考SCWCD有出現這題...我是選 d e
結果好像錯了...我也是覺得該選 b d e 可惜考試就
要您挑 2個正確答案


reply to postreply to post
平常認真工作 , 假日正常休假...陪女友到處逛逛
經濟尚可就好...親人健康平安...人生在世...還有
什麼不滿足呢??
作者 Re:SCWCD Mock Exam [Re:swanky]
b701209





發文: 3
積分: 0
於 2004-05-02 23:50 user profilesend a private message to userreply to postreply to postsearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
QUESTION NO: 137

答案應該是 D....
---------------------------------------------

Embaressed對不起 是E
<session-timeout>才是以分為單位


b701209 edited on 2004-05-03 12:04
reply to postreply to post
作者 Re:SCWCD Mock Exam [Re:b701209]
frankyilee

賤兔玩星海...



發文: 60
積分: 1
於 2004-05-03 01:18 user profilesend a private message to userreply to postreply to postsearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
b701209 wrote:
QUESTION NO: 137

答案應該是 D....


setMaxInactiveInterval() 是以秒為單位.....
答案是 E 並沒有錯


reply to postreply to post
平常認真工作 , 假日正常休假...陪女友到處逛逛
經濟尚可就好...親人健康平安...人生在世...還有
什麼不滿足呢??
作者 Re:SCWCD Mock Exam [Re:swanky]
des001





發文: 56
積分: 0
於 2004-05-09 04:40 user profilesend a private message to userreply to postreply to postsearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
抱走熊兄
正在複習您整理的模考題..很棒的整理!
發現Question 92 的 javax.servlet.jsp.target.Tag
有點筆誤,應為 javax.servlet.jsp.tagext.Tag
雖不是什麼大錯誤,還是很雞婆的提一下
怕別的朋友一時誤會了.......^^


reply to postreply to post
作者 Re:SCWCD Mock Exam [Re:des001]
swanky

暴走熊

版主

發文: 461
積分: 9
於 2004-05-09 08:12 user profilesend a private message to usersend email to swankyreply to postreply to postsearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
des001 wrote:
抱走熊兄
正在複習您整理的模考題..很棒的整理!
發現Question 92 的 javax.servlet.jsp.target.Tag
有點筆誤,應為 javax.servlet.jsp.tagext.Tag
雖不是什麼大錯誤,還是很雞婆的提一下
怕別的朋友一時誤會了.......^^

已更正
感謝~Smile


reply to postreply to post
作者 Re:SCWCD Mock Exam [Re:swanky]
paulma





發文: 76
積分: 5
於 2004-12-31 17:35 user profilesend a private message to userreply to postreply to postsearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
請問這份考題適用SCWCD1.4 版本嗎? 謝謝!

reply to postreply to post
作者 Re:SCWCD Mock Exam [Re:paulma]
swanky

暴走熊

版主

發文: 461
積分: 9
於 2005-01-04 16:23 user profilesend a private message to usersend email to swankyreply to postreply to postsearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
paulma wrote:
請問這份考題適用SCWCD1.4 版本嗎? 謝謝!

不適用喔
這是1.3的~


reply to postreply to post
作者 Re:SCWCD Mock Exam [Re:swanky]
ttlz





發文: 10
積分: 0
於 2005-01-15 00:57 user profilesend a private message to userreply to postreply to postsearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
先感谢一下斑竹
请问第70题
选项c 为什么不行


reply to postreply to post
作者 Re:SCWCD Mock Exam [Re:swanky]
emt2a7





發文: 71
積分: 3
於 2005-05-19 22:56 user profilesend a private message to userreply to postreply to postsearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
回答第70題:
因為給0或是0以上的正值,session是會time out掉的,
給個負值,比如說-1,那這樣session就永遠不會time out掉的,除非把Servlet Container給關掉。
PS.如有錯誤,請指教。新手~~~


reply to postreply to post
作者 Re:101~110(7題) 解答 [Re:frankyilee]
edmak





發文: 1
積分: 0
於 2005-07-12 05:18 user profilesend a private message to userreply to postreply to postsearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
I think the answer should be B , E.
Answer D is unlikely to be correct becuase pages are not directly accessible under META_INF. ( rf. Head First JSP & Servlet p582 )


reply to postreply to post
作者 Re:SCWCD Mock Exam [Re:swanky]
nightsky_ting





發文: 5
積分: 0
於 2005-08-12 01:30 user profilesend a private message to userreply to postreply to postsearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
This mock exam is for version 1.4 or 1.3??

reply to postreply to post
作者 Re:SCWCD Mock Exam [Re:swanky]
u8806145





發文: 37
積分: 0
於 2006-04-06 23:22 user profilesend a private message to userreply to postreply to postsearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
在第111題中:
我想只要是*.bop...都可以對到吧


reply to postreply to post
作者 Re:101~110(7題) 解答 [Re:edmak]
judyleoalan





發文: 6
積分: 0
於 2006-11-01 04:22 user profilesend a private message to userreply to postreply to postsearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
I think you are ***ed up

reply to postreply to post
作者 Re:SCWCD Mock Exam [Re:swanky]
smallchickenray





發文: 15
積分: 0
於 2006-11-06 16:40 user profilesend a private message to userreply to postreply to postsearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
我也針對第111題做測試:

答案應該是A.B.D.E, 只要是以Web application name : http://servername/ 開頭, 而檔名為*.bop, 都可以yoshi這支servlet.


reply to postreply to post
作者 Re:SCWCD Mock Exam [Re:swanky]
smallchickenray





發文: 15
積分: 0
於 2006-11-06 16:50 user profilesend a private message to userreply to postreply to postsearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
上一篇po文漏了一些字@@, 補一下:

我也針對第111題做測試:

答案應該是A.B.D.E, 只要url是以Web application name : http://servername/ 開頭, 而副檔名為*.bop結尾, 都可以呼叫到yoshi這支servlet


reply to postreply to post
go to first page go to previous page  1   2   3  go to next page go to last page
» JWorld@TW »  Java Certification » SCWCD

reply to topicthreaded modego to previous topicgo to next topic
  已讀文章
  新的文章
  被刪除的文章
Jump to the top of page

JWorld@TW 本站商標資訊

Powered by Powerful JuteForum® Version Jute 1.5.8