![]() |
JBridge: Certification Question Of The Day |
| JBridge Home >> Certification Questions >> Today's Question | Wednesday 7th May 2003 |
|
Given a web application with a context root of MyWebApp with a servlet mapping as follows: <servlet-mapping> <servlet-name>MyServlet</servlet-name> <url-pattern>/MyServlet/*</url-pattern> </servlet-mapping>And a request to the web application in this form: http://localhost:8080/MyWebApp/MyServlet/action/cinema?film=FargoWhat is returned from the following code in MyServlet? request.getPathInfo(); A A String containing “/action/cinema” B A URL in the form “http://localhost:8080/MyWebApp/MyServlet/action/cinema”
C A URL in the form “http://localhost:8080/MyWebApp/MyServlet”
D A String containing “/MyWebApp/MyServlet/action/cinema” E A String containing “/cinema” F A String containing “/action/cinema?film=Fargo” G A URI in the form “/MyWebApp/MyServlet”
H Nothing is returned as the code could never be executed: the request URL does not find MyServlet. Page down for the answer... The AnswerThe correct answer is A, a String containing
“/action/cinema”. |
EMail: dbridgewater@jbridge.co.uk
Phone: +44 (0)1943 877414
Fax: +44 (0)1943 877414
Mail: David
Bridgewater, Willow Dene, Bradford Road, Menston, Ilkley, West Yorkshire, LS29
6ED, UK
Copyright © 2003 David Bridgewater. All rights reserved.