Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Context path , servlet path and path info confusion.

843842Jan 21 2009 — edited Jan 21 2009
Hello,
while being through mocks , I came across through couple of path related question from javabeat mock.
In below question , the answers are differing. Specially with reference to a query string . I far as I know , query string isnt a part of path info.
Req URI = Contextpath+servletpath+pathinfo
Can any one please help me in getting this confusion clear.
[color=red]
Pick out the context path, Servlet path and path information from the request
path '/books/Find/abcd?query=Java' (assuming that the context is 'books')?
a. '/books', '/Find' and '/abcd'
b. '/books', '/Find/abcd' and 'query=Java'
c. '/books/Find', '/abcd' and 'query=Java'
d. None of the above.
ANS : A[color]

[color=orange]What will be the value of the context path, Servlet path and the path info
elements, if the request path is music/Play/album1234?name='xyz' (assuming
that the context of the Web Application is 'music')?
a. Play, album1234 and name='xyz'
b. music, Play and album1234?name='xyz'
c. music, Play and album1234
d. music, Play/ album1234 and name='xyz'
ANS : D[color]
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 18 2009
Added on Jan 21 2009
2 comments
1,150 views