310-083 無料問題集「SUN Sun Certified Web Component Developer for J2EE 5」
Click the Exhibit button.
As a maintenance feature, you have created this servlet to allow you to upload and remove files on your web server. Unfortunately, while testing this servlet, you try to upload a file using an HTTP request and on this servlet, the web container returns a 404 status.
What is wrong with this servlet?

As a maintenance feature, you have created this servlet to allow you to upload and remove files on your web server. Unfortunately, while testing this servlet, you try to upload a file using an HTTP request and on this servlet, the web container returns a 404 status.
What is wrong with this servlet?

正解:B
解答を投票する
Given the two security constraints in a deployment descriptor:
1 01. <security-constraint>
1 02. <!--a correct url-pattern and http-method goes here-->
1 03. <auth-constraint><role-name>SALES</role-name></auth-
1 03. <auth-constraint>
1 04. <role-name>SALES</role-name>
1 05. </auth-constraint>
1 06. </security-constraint>
1 07. <security-constraint>
1 08. <!--a correct url-pattern and http-method goes here-->
1 09. <!-- Insert an auth-constraint here -->
1 10. </security-constraint>
If the two security constraints have the same url-pattern and http-method, which two, inserted independently at line 109, will allow users with role names of either SALES or
MARKETING to access this resource? (Choose two.)
1 01. <security-constraint>
1 02. <!--a correct url-pattern and http-method goes here-->
1 03. <auth-constraint><role-name>SALES</role-name></auth-
1 03. <auth-constraint>
1 04. <role-name>SALES</role-name>
1 05. </auth-constraint>
1 06. </security-constraint>
1 07. <security-constraint>
1 08. <!--a correct url-pattern and http-method goes here-->
1 09. <!-- Insert an auth-constraint here -->
1 10. </security-constraint>
If the two security constraints have the same url-pattern and http-method, which two, inserted independently at line 109, will allow users with role names of either SALES or
MARKETING to access this resource? (Choose two.)
正解:B、D
解答を投票する
Given a JSP page:
1 1. <n:recurse>
1 2. <n:recurse>
1 3. <n:recurse>
1 4. <n:recurse />
1 5. </n:recurse>
1 6. </n:recurse>
1 7. </n:recurse>
The tag handler for n:recurse extends SimpleTagSupport.
Assuming an n:recurse tag can either contain an empty body or another n:recurse tag, which strategy allows the tag handler for n:recurse to output the nesting depth of the deepest n:recurse tag?
1 1. <n:recurse>
1 2. <n:recurse>
1 3. <n:recurse>
1 4. <n:recurse />
1 5. </n:recurse>
1 6. </n:recurse>
1 7. </n:recurse>
The tag handler for n:recurse extends SimpleTagSupport.
Assuming an n:recurse tag can either contain an empty body or another n:recurse tag, which strategy allows the tag handler for n:recurse to output the nesting depth of the deepest n:recurse tag?
正解:C
解答を投票する
You are creating a library of custom tags that mimic the HTML form tags. When the user submits a form that fails validation, the JSP form is forwarded back to the user. The
< t:textField> tag must support the ability to re-populate the form field with the request parameters from the user's last request. For example, if the user entered "Samantha" in the text field called firstName, then the form is re-populated like this:
< input type='text' name='firstName' value='Samantha' />
Which tag handler method will accomplish this goal?
< t:textField> tag must support the ability to re-populate the form field with the request parameters from the user's last request. For example, if the user entered "Samantha" in the text field called firstName, then the form is re-populated like this:
< input type='text' name='firstName' value='Samantha' />
Which tag handler method will accomplish this goal?
正解:A
解答を投票する
After a merger with another small business, your company has inherited a legacy WAR file but the original source files were lost. After reading the documentation of that web application, you discover that the WAR file contains a useful tag library that you want to reuse in your own webapp packaged as a WAR file.
What do you need to do to reuse this tag library?
What do you need to do to reuse this tag library?
正解:A
解答を投票する
Given the JSP code:
< % request.setAttribute("foo", "bar"); %>
and the Classic tag handler code:
5 . public int doStartTag() throws JspException {
6 . // insert code here
7 . // return int
8 . }
Assume there are no other "foo" attributes in the web application.
Which invocation on the pageContext object, inserted at line 6, assigns "bar" to the variable x?
< % request.setAttribute("foo", "bar"); %>
and the Classic tag handler code:
5 . public int doStartTag() throws JspException {
6 . // insert code here
7 . // return int
8 . }
Assume there are no other "foo" attributes in the web application.
Which invocation on the pageContext object, inserted at line 6, assigns "bar" to the variable x?
正解:D
解答を投票する
