aspose file tools*
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes Tricky Mock Question Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "Tricky Mock Question" Watch "Tricky Mock Question" New topic
Author

Tricky Mock Question

Alec Lee
Ranch Hand

Joined: Jan 28, 2004
Posts: 569
(I dont think there are 3 valid answers - only D E)

Which three are valid URL mappings to a servlet in a web deployment descriptor?
(Choose three.)
A. */*
B. /*.do
C. myServlet
D. /Myservlet
E. /MyServlet/*
F. MyServlet/*.isp
Alec Lee
Ranch Hand

Joined: Jan 28, 2004
Posts: 569
A crazy thought. Can we use a URL ../myappl/*.do - the URL contains the * character?
Vishnu Prakash
Ranch Hand

Joined: Nov 15, 2004
Posts: 1026
Option b is also correct.


Servlet Spec 2.4/ Jsp Spec 2.0/ JSTL Spec 1.1 - JSTL Tag Documentation
Alec Lee
Ranch Hand

Joined: Jan 28, 2004
Posts: 569
why? what does B map to?

As a matter of fact, tomcat gives me this when I deploy with a mapping like B

java.lang.IllegalArgumentException: Invalid <url-pattern> /*.do in servlet mapping
at org.apache.commons.digester.Digester.createSAXException(Digester.java:2540)
at org.apache.commons.digester.Digester.createSAXException(Digester.java:2566)
at org.apache.commons.digester.Digester.endElement(Digester.java:1061)
at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanEndElement(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
David Ulicny
Ranch Hand

Joined: Aug 04, 2004
Posts: 724
What about option C. It could be right.


SCJP<br />SCWCD <br />ICSD(286)<br />MCP 70-216
B.Sathish
Ranch Hand

Joined: Aug 18, 2005
Posts: 372
Where did you get this question from This is what I had got in my exam. I answered B,D and E and got it right
David Ulicny
Ranch Hand

Joined: Aug 04, 2004
Posts: 724
I don't understand how B could be right.
B.Sathish
Ranch Hand

Joined: Aug 18, 2005
Posts: 372
I too thought it was crazy, but I could not select the other options as they seemed very wrong (apart from the other 2 correct ones)
Annie McCall
Greenhorn

Joined: Apr 17, 2003
Posts: 21
Ok, I tried all of the them and looks like there are only 2 correct answers - D & E.

I tried /*.do on tomcat and got the same error Alec got.



Annie McCall<br />SCJP 1.4<br />SCWCD
Will Lee
Ranch Hand

Joined: Mar 16, 2005
Posts: 58
I remember the HFSJ said that for url pattern, if you use path, it must start with "/", or you can use wild cast (*.do) with no start "/". So how answer B could be right?

Don't have book in hand, so I don't know if my memory is "stale"


SCJP 1.4, SCWCD, SCDJWS
Nicky Eng
Ranch Hand

Joined: Mar 26, 2005
Posts: 378
yeah yeah....my answer would be D & E .

i think i saw this question somewhere....

why choice B is correct?

is

/*

same as

/*.do

...because .do just a convention, so not be a problem???

for me, answer D & E.
[ September 28, 2005: Message edited by: Nicky Eng ]

From NickyEng
Diploma in Computer Studies
SCJP 1.4
SCWCD 1.4
Formula 1 app by Maxis (Playbook)
Rizwan Mohammad
Ranch Hand

Joined: Sep 02, 2005
Posts: 445
According to me only there are two valid answers as been discussed.


Rizwan
SCJA, SCJP, SCWCD, SCBCD, SCDJWS.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Tricky Mock Question