310-083: Sun Certified Web Component Developer for J2EE 5

  • 828
  • 0

摘要:310-083: Sun Certified Web Component Developer for J2EE 5

310-083.rarSCWCD 310-083考試題庫由TestPassPort資深IT認證講師和SCWCD產品專家結合PROMETRIC或VUE的真實310-083考試環境最新原題傾心打造。
題庫覆蓋了當前最新的真實考題,並且全部附有正確答案,我們承諾題庫對SCWCD 310-083(Sun Certified Web Component Developer for J2EE 5)考試原題完整覆蓋。310-083題庫助您輕鬆通過認證考試,一次不過全額退款。
 1.You are creating a JSP page to display a collection of data. This data can be displayed in several
different ways so the architect on your project decided to create a generic servlet that generates a
commadelimited
string so that various pages can render the data in different ways. This servlet takes on
request parameter: objectID.
Assume that this servlet is mapped to the URL pattern: /WEBINF/
data.
In the JSP you are creating, you need to split this string into its elements separated by commas and
generate an HTML <ul> list from the data.
Which JSTL code snippet will accomplish this goal?
A. <c:import varReader='dataString' url='/WEBINF/
data'>
<c:param name='objectID' value='${currentOID}' />
</c:import>
<ul>
<c:forTokens items'${dataString.split(",")}' var='item'>
<li>${item}</li>
</c:forTokens>
</ul>
B. <c:import varReader='dataString' url='/WEBINF/
data'>
<c:param name='objectID' value='${currentOID}' />
</c:import>
<ul>
<c:forTokens items'${dataString}' delims=',' var='item'>
<li>${item}</li>
</c:forTokens>
</ul>
C. <c:import var='dataString' url='/WEBINF/
data'>
<c:param name='objectID' value='${currentOID}' />
</c:import>
<ul><c:forTokens items'${dataString.split(",")}' var='item'>
<li>${item}</li>
</c:forTokens>
</ul>
D. <c:import var='dataString' url='/WEBINF/
data'>
<c:param name='objectID' value='${currentOID}' />
</c:import>
<ul>
<c:forTokens items'${dataString}' delims=',' var='item'>
<li>${item}</li>
</c:forTokens>
</ul>
Answer:D
2.You web application uses a lot of Java enumerated types in the domain model of the application. Built
into each enum type is a method, getDisplay(), which returns a localized, useroriented
string. There are
many uses for presenting enums within the web
application,
so your manager has asked you to create a custom tag that iterates over the set of enum values and
processes
the body of the tag once for each value; setting the value into a pagescoped
attribute called, enumValue.
Here is an example of how this tag is used:
10: <select name='season'>
11: <t:everyEnum type='com.example.Season'>
12: <option value='${enumValue}'>${enumValue.display}</option>
13: </t:everyEnum>
14: </select>
| English | Chinese(Traditional) | Chinese(Simplified) | 4
KillTest
Information Co., Ltd. All rights reserved.
You have decided to use the Simple tag model to create this tag handler.
Which tag handler method will
accomplish this goal?
A. public void doTag() throw JspException {
try {
for ( Enum value : getEnumValues() ) {
pageContext.setAttribute("enumValue", value);
getJspBody().invoke(getOut());
}
} (Exception e) { throw new JspException(e); }
}
B. public void doTag() throw JspException {
try {
for ( Enum value : getEnumValues() ) {
getJspContext().setAttribute("enumValue", value);
getJspBody().invoke(null);
}
} (Exception e) { throw new JspException(e); }
}
C. public void doTag() throw JspException {
try {
for ( Enum value : getEnumValues() ) {
getJspContext().setAttribute("enumValue", value);
getJspBody().invoke(getJspContext().getWriter());
}
} (Exception e) { throw new JspException(e); }
}
D. public void doTag() throw JspException {

try {
for ( Enum value : getEnumValues() ) {
pageContext.setAttribute("enumValue", value);
getJspBody().invoke(getJspContext().getWriter());
}
} (Exception e) { throw new JspException(e); }
}
Answer:B