Welcome to Scribd, the world's digital library. Read, publish, and share books and documents. See more
Download
Standard view
Full view
of .
Look up keyword
Like this
5Activity
0 of .
Results for:
No results containing your search query
P. 1
Questions

Questions

Ratings: (0)|Views: 160 |Likes:
Published by api-3775545

More info:

Published by: api-3775545 on Oct 18, 2008
Copyright:Attribution Non-commercial

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as DOC, PDF, TXT or read online from Scribd
See more
See less

03/18/2014

pdf

text

original

The implicit JSP objects likereq uest,respo nse, andou t are only visible in the
_jspService()met hod.
Answer: (A) Unless passed in as arguments to other methods, the
implicit JSP arguments are only visible in thejsp Service() method. See
JSP Implicit Objects.

How can a servlet call a JSP error page?
A. This capability is not supported.
B. When the servlet throws the exception, it will automatically be caught by the calling

JSP page.

C. The servlet needs to forward the request to the specific error page URL. The
exception is passed along as an attribute named "javax.servlet.jsp.jspException".
D. The servlet needs to redirect the response to the specific error page, saving the
exception off in a cookie.
Answer (C): D will get the browser to display the appropriate page, it just doesn't
preserve the state information requiring an unnecessary round trip to the browser. C is the
direct approach. See Exception Handling and the jGuru JSP FAQ.

Sun\u2019s ePractice:
Given this text from a validweb.xml file for a web application to be deployed
atwww.myorg.org:

<servlet>
<servlet\u00adname>shopping</servlet\u00adname>
<servlet\u00adclass>org.myorg.ShoppingServlet</servlet\u00adclass>
<init\u00adparam>

<param\u00adname>year</param\u00adname>
<param\u00advalue>2004</param\u00advalue>

</init\u00adparam>
</servlet>
<servlet\u00admapping>

<servlet\u00adname>shopping</servlet\u00adname>
<url\u00adpattern>/shop/*</url\u00adpattern>
</servlet\u00admapping>
Which is true?
A
Requests for the URLhttp://www.myorg.org/shopping will be
sent to theorg.myorg.ShoppingSer vlet servlet.
B
It would be invalid to add another< s e r vlet > element that also included
<servlet\u00adname>shopping</servlet\u00adname>.

Activity (5)

You've already reviewed this. Edit your review.
1 hundred reads
1 thousand reads
Walid_Sassi_Tun liked this
Amata P liked this
rohitpr1111 liked this

You're Reading a Free Preview

Download
scribd
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->